This commit is contained in:
illustris 2022-02-12 11:02:18 +05:30
parent 37848ee9c4
commit 2b296e69f5
Signed by: illustris
GPG Key ID: 56C8FC0B899FEFA3
6 changed files with 275 additions and 114 deletions

View File

@ -1,8 +1,4 @@
{ { config, pkgs, ... }:
config,
pkgs,
...
}:
{ {
@ -10,13 +6,13 @@
]; ];
# Use nixpkgs from niv # Use nixpkgs from niv
nixpkgs.pkgs = let #nixpkgs.pkgs = let
sources = import ./nix/sources.nix; # sources = import ./nix/sources.nix;
in import sources.nixpkgs { #in import sources.nixpkgs {
config = config.nixpkgs.config // { # config = config.nixpkgs.config // {
allowUnfree = true; # allowUnfree = true;
}; # };
}; #};
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -24,93 +20,143 @@
]; ];
# Support ARM builds # Support ARM builds
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot = {
binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.kernelPackages = pkgs.linuxPackages_latest; kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.loader.systemd-boot.enable = true; loader = {
boot.loader.efi.canTouchEfiVariables = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
boot.supportedFilesystems = [ "zfs" ]; supportedFilesystems = [ "zfs" ];
boot.zfs.devNodes = "/dev/disk/by-partuuid"; zfs.devNodes = "/dev/disk/by-partuuid";
networking.hostId = "f86b2fa7"; };
time.timeZone = "Asia/Kolkata"; time.timeZone = "Asia/Kolkata";
networking.hostName = "desktop"; # Define your hostname. networking = {
networking.useDHCP = false; hostId = "f86b2fa7";
#networking.interfaces.enp6s18.useDHCP = true;
networking.interfaces.enp6s18.useDHCP = true;
hostName = "desktop";
useDHCP = false;
interfaces = {
enp6s18.useDHCP = true;
enp11s0.useDHCP = true;
};
#hosts = {
#};
};
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
users.users = { users.users = {
illustris = { illustris = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" "tty" "adb" ]; extraGroups = [ "wheel" "docker" "tty" "adb" "libvirtd" ];
openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ]; openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ];
}; };
root.openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ]; root.openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ];
}; };
programs.adb.enable = true; environment = {
systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [ asciinema
git bind
tmux binutils-unwrapped
htop
nfs-utils
bmon bmon
sysstat cmatrix # More useful than you might think
(pass.withExtensions (exts: [ exts.pass-otp ])) #ec2_api_tools
nnn ethtool
expect
fatrace
file
gdb
git
gnumake
#graphviz
htop
#imagemagick
iotop
iperf
jq
killall
latencytop
linuxPackages.perf
lsof
mosh mosh
ncdu ncdu
(writeScriptBin "vpnpass" (builtins.readFile ./scripts/vpnpass)) neofetch
wget networkmanager
expect nfs-utils
nix-du
nix-prefetch-git
nix-tree
nnn
openvpn openvpn
tcpdump
killall
file
tree
ntfs3g
p7zip p7zip
ranger
cscope
python
bind # for nslookup
ethtool
unzip
pciutils pciutils
powertop
pv
python3
pythonPackages.percol
ranger
screen
sshfs sshfs
jq surf
nixpkgs-review sysstat
(pkgs.callPackage /home/illustris/src/percol/percol {}) tmate
niv tmux
( tree
rofi.override { plugins = [ unzip
rofi-calc usbutils
rofi-pass valgrind
rofi-systemd virt-manager
]; } wget
) youtube-dl
nmap (cscope.override{emacsSupport = false;})
fping #(emacs.override{withGTK3 = false; withX = false;})
(pass.withExtensions (exts: [ exts.pass-otp ]))
((pkgs.callPackage ./packages/passcol) { })
(writeScriptBin "vpnpass" (builtins.readFile ./scripts/vpnpass))
]; ];
etc = {
programs.gnupg.agent = { openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn";
enable = true; nixpkgs.source = let sources = import ./nix/sources.nix; in sources.nixpkgs;
};
}; };
programs.bash = { #programs.bash = {
# interactiveShellInit = ''
# export HISTSIZE=-1 HISTFILESIZE=-1 HISTCONTROL=ignoreboth:erasedups;
# '';
# shellAliases = {
# genpass = "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 2";
# };
# promptInit = ''
# if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then
# PROMPT_COLOR="1;31m"
# let $UID && PROMPT_COLOR="1;36m"
# PS1="\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] "
# fi
# '';
#};
programs = {
adb.enable = true;
bash = {
interactiveShellInit = '' interactiveShellInit = ''
export HISTSIZE=-1 HISTFILESIZE=-1 HISTCONTROL=ignoreboth:erasedups; export HISTSIZE=-1 HISTFILESIZE=-1 HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
''; '';
shellAliases = { shellAliases = {
genpass = "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 2"; genpass = "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 2";
nt = "sudo nix-shell /etc/nixos/shell.nix --run \"nixos-rebuild test\"";
ns = "sudo nix-shell /etc/nixos/shell.nix --run \"nixos-rebuild switch\"";
grep = "grep --color";
}; };
promptInit = '' promptInit = ''
if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then
@ -121,6 +167,18 @@
''; '';
}; };
# for virt-manager
dconf.enable = true;
gnupg.agent = {
enable = true;
pinentryFlavor = "curses";
};
mosh.enable = true;
mtr.enable = true;
ssh.startAgent = true;
};
services = { services = {
openssh = { openssh = {
enable = true; enable = true;
@ -134,10 +192,14 @@
}; };
ntp.enable = true; ntp.enable = true;
zerotierone.enable = true; zerotierone.enable = true;
flatpak.enable = true;
gnome3.gnome-keyring.enable = true;
}; };
environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn";
virtualisation.docker.enable = true; virtualisation = {
docker.enable = true;
libvirtd.enable = true;
};
# Temporary fix for qemu-ga till #112886 gets merged # Temporary fix for qemu-ga till #112886 gets merged
systemd.services.qemu-guest-agent = { systemd.services.qemu-guest-agent = {
@ -148,14 +210,19 @@
RestartSec = 0; RestartSec = 0;
}; };
}; };
networking.hosts = {
"192.168.1.8" = ["git.illustris.tech"];
"192.168.1.10" = ["kube-master"];
};
networking.firewall.enable = false; networking.firewall.enable = false;
nix.trustedUsers = [ "root" "illustris" ]; nix = {
autoOptimiseStore = true;
nixPath = [
"nixpkgs=${pkgs.path}"
"nixos-config=/etc/nixos/configuration.nix"
];
trustedUsers = [ "root" "illustris" ];
};
xdg.portal.enable = true;
# In case of emergency, bash glass # In case of emergency, bash glass
#systemd.tmpfiles.rules = [ #systemd.tmpfiles.rules = [
@ -168,7 +235,7 @@
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.03"; # Did you read the comment? system.stateVersion = "21.05"; # Did you read the comment?
} }

View File

@ -27,16 +27,65 @@
#backend = "xr_glx_hybrid"; #backend = "xr_glx_hybrid";
backend = "glx"; backend = "glx";
}; };
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
socketActivation = true;
config.pipewire = {
#"context.properties" = {
# "link.max-buffers" = 16;
# "log.level" = 2;
# "default.clock.rate" = 48000;
# "default.clock.quantum" = 32;
# "default.clock.min-quantum" = 32;
# "default.clock.max-quantum" = 32;
# "core.daemon" = true;
# "core.name" = "pipewire-0";
#};
#"context.modules" = [
# {
# name = "libpipewire-module-rtkit";
# args = {
# "nice.level" = -15;
# "rt.prio" = 88;
# "rt.time.soft" = 200000;
# "rt.time.hard" = 200000;
# };
# flags = [ "ifexists" "nofail" ];
# }
# { name = "libpipewire-module-protocol-native"; }
# { name = "libpipewire-module-profiler"; }
# { name = "libpipewire-module-metadata"; }
# { name = "libpipewire-module-spa-device-factory"; }
# { name = "libpipewire-module-spa-node-factory"; }
# { name = "libpipewire-module-client-node"; }
# { name = "libpipewire-module-client-device"; }
# {
# name = "libpipewire-module-portal";
# flags = [ "ifexists" "nofail" ];
# }
# {
# name = "libpipewire-module-access";
# args = {};
# }
# { name = "libpipewire-module-adapter"; }
# { name = "libpipewire-module-link-factory"; }
# { name = "libpipewire-module-session-manager"; }
#];
};
};
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
programs.steam.enable = true; programs.steam.enable = true;
programs.chromium = { programs.chromium = {
enable = true; enable = true;
extraOpts = {
"PasswordManagerEnabled" = false;
"ClearSiteDataOnExit" = false;
};
extensions = [ extensions = [
"gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere "gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
@ -45,10 +94,17 @@
"gppongmhjkpfnbhagpmjfkannfbllamg" # wappalyzer "gppongmhjkpfnbhagpmjfkannfbllamg" # wappalyzer
"lcbjdhceifofjlpecfpeimnnphbcjgnc" # xBrowserSync "lcbjdhceifofjlpecfpeimnnphbcjgnc" # xBrowserSync
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet "chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
"aghfnjkcakhmadgdomlmlhhaocbkloab" # just black
"fmkadmapgofadopljbjfkapdkoienihi" # React Developer Tools
]; ];
homepageLocation = "https://duckduckgo.com/"; homepageLocation = "https://sx.illustris.tech/";
defaultSearchProviderSuggestURL = "https://duckduckgo.com/?q={searchTerms}&kp=-1&kac=1"; defaultSearchProviderSuggestURL = "https://sx.illustris.tech/autocompleter?q={searchTerms}";
defaultSearchProviderSearchURL = "https://duckduckgo.com/?q=search&kp=-1"; defaultSearchProviderSearchURL = "https://sx.illustris.tech/search?q={searchTerms}";
extraOpts = {
DefaultSearchProviderEnabled = true;
DefaultSearchProviderName = "Sx";
DefaultCookiesSetting = 1;
};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
st st
@ -58,8 +114,8 @@
sublime3 sublime3
perlPackages.AppClusterSSH perlPackages.AppClusterSSH
x11vnc x11vnc
kcachegrind #kcachegrind
remmina #remmina
insomnia insomnia
vlc vlc
openhmd openhmd
@ -69,8 +125,8 @@
signal-desktop signal-desktop
sxiv sxiv
scrot scrot
(libsForQt5.callPackage (import ./packages/rescuetime/default.nix) {}) #(libsForQt5.callPackage (import ./packages/rescuetime/default.nix) {})
surf #surf
gnome3.gnome-screenshot gnome3.gnome-screenshot
blender blender
wireshark wireshark
@ -80,10 +136,13 @@
libnotify libnotify
ungoogled-chromium ungoogled-chromium
zoom-us zoom-us
guake
]; ];
security.rtkit.enable = true;
hardware.pulseaudio = { hardware.pulseaudio = {
enable = true; enable = false;
daemon.config.default-sample-channels = 6; daemon.config.default-sample-channels = 6;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;
#extraConfig = '' #extraConfig = ''

View File

@ -11,7 +11,7 @@
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "v4l2loopback" ]; boot.kernelModules = [ "v4l2loopback" ];
boot.extraModulePackages = [ pkgs.linuxPackages_latest.v4l2loopback ]; boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
fileSystems = { fileSystems = {
"/" = { "/" = {

View File

@ -5,10 +5,10 @@
"homepage": "https://github.com/nmattia/niv", "homepage": "https://github.com/nmattia/niv",
"owner": "nmattia", "owner": "nmattia",
"repo": "niv", "repo": "niv",
"rev": "af958e8057f345ee1aca714c1247ef3ba1c15f5e", "rev": "9cb7ef336bb71fd1ca84fc7f2dff15ef4b033f2a",
"sha256": "1qjavxabbrsh73yck5dcq8jggvh3r2jkbr6b5nlz5d9yrqm9255n", "sha256": "1ajyqr8zka1zlb25jx1v4xys3zqmdy3prbm1vxlid6ah27a8qnzh",
"type": "tarball", "type": "tarball",
"url": "https://github.com/nmattia/niv/archive/af958e8057f345ee1aca714c1247ef3ba1c15f5e.tar.gz", "url": "https://github.com/nmattia/niv/archive/9cb7ef336bb71fd1ca84fc7f2dff15ef4b033f2a.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"nixpkgs": { "nixpkgs": {
@ -17,10 +17,10 @@
"homepage": "", "homepage": "",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a73020b2a150322c9832b50baeb0296ba3b13dd7", "rev": "48d63e924a2666baf37f4f14a18f19347fbd54a2",
"sha256": "1s0ckc2qscrflr7bssd0s32zddp48dg5jk22w1dip2q2q7ks6cj0", "sha256": "0dcxc4yc2y5z08pmkmjws4ir0r2cbc5mha2a48bn0bk7nxc6wx8g",
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a73020b2a150322c9832b50baeb0296ba3b13dd7.tar.gz", "url": "https://github.com/NixOS/nixpkgs/archive/48d63e924a2666baf37f4f14a18f19347fbd54a2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
} }
} }

View File

@ -0,0 +1,21 @@
{ stdenv, python3Packages, pass, xdotool, fetchFromGitHub }:
stdenv.mkDerivation rec {
version = "1.0.0";
pname = "passcol";
src = fetchFromGitHub {
owner = "illustris";
repo = "passcol";
rev = "6bca0a85a6394e1fabab6790e9191f64d4bad281";
sha256 = "1hj5ks382i5cafl6kz7576v59iqc73k90wr6567qcbl6xzgx9iq2";
};
buildInputs = [
pass python3Packages.percol xdotool
];
installPhase = ''
mkdir -p $out/bin
cp passcol.sh $out/bin/passcol
'';
}

14
shell.nix Normal file
View File

@ -0,0 +1,14 @@
{
sources ? import ./nix/sources.nix,
pkgs ? import sources.nixpkgs {}
}:
pkgs.mkShell {
buildInputs = with pkgs; [
niv
];
shellHook = ''
export nixpkgs=${pkgs.path}
export NIX_PATH=nixpkgs=${pkgs.path}:nixos-config=/etc/nixos/configuration.nix
'';
}