diff --git a/configuration/hosts/beltane/configuration.nix b/configuration/hosts/beltane/configuration.nix index 7fa04be7..4f5166e4 100644 --- a/configuration/hosts/beltane/configuration.nix +++ b/configuration/hosts/beltane/configuration.nix @@ -1,19 +1,19 @@ { config, pkgs, ... }: -let unstable = import {}; in { - imports = - [ - ../../profiles/common - ./hardware-configuration.nix - #./services/postgres.nix - ./services/znc.nix - ./services/weechat.nix - #./services/gitea.nix - #./services/matrix.nix - #./services/nextcloud.nix - #./services/bitwarden.nix - ./services/nginx.nix - ]; +let unstable = import { }; +in { + imports = [ + ../../profiles/common + ./hardware-configuration.nix + #./services/postgres.nix + ./services/znc.nix + ./services/weechat.nix + #./services/gitea.nix + #./services/matrix.nix + #./services/nextcloud.nix + #./services/bitwarden.nix + ./services/nginx.nix + ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; diff --git a/configuration/hosts/beltane/hardware-configuration.nix b/configuration/hosts/beltane/hardware-configuration.nix index 8bf097ba..f7d39c19 100644 --- a/configuration/hosts/beltane/hardware-configuration.nix +++ b/configuration/hosts/beltane/hardware-configuration.nix @@ -4,23 +4,21 @@ { config, lib, pkgs, ... }: { - imports = - [ - ]; + imports = [ ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = + [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/126049c0-34bd-4d96-a8db-276c5d172abe"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/126049c0-34bd-4d96-a8db-276c5d172abe"; + fsType = "ext4"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/1f19daed-1c51-4b14-bfe8-bd7ea075ed96"; } - ]; + [{ device = "/dev/disk/by-uuid/1f19daed-1c51-4b14-bfe8-bd7ea075ed96"; }]; nix.maxJobs = lib.mkDefault 3; } diff --git a/configuration/hosts/default.nix b/configuration/hosts/default.nix index 77ece001..b312553f 100644 --- a/configuration/hosts/default.nix +++ b/configuration/hosts/default.nix @@ -17,13 +17,15 @@ let groups = [ "desktop" "personal" ]; }; }; - pkgs = import {}; + pkgs = import { }; evalConfig = import ; lib = pkgs.lib; -in lib.mapAttrs (name: host: host // { - config = if (host ? config) then host.config else (evalConfig { - modules = [ - (import "${toString ./.}/${name}/configuration.nix") - ]; - }).config; -}) hosts +in lib.mapAttrs (name: host: + host // { + config = if (host ? config) then + host.config + else + (evalConfig { + modules = [ (import "${toString ./.}/${name}/configuration.nix") ]; + }).config; + }) hosts diff --git a/configuration/hosts/litha/configuration.nix b/configuration/hosts/litha/configuration.nix index 2ef9c44c..41285ffe 100644 --- a/configuration/hosts/litha/configuration.nix +++ b/configuration/hosts/litha/configuration.nix @@ -5,25 +5,24 @@ { config, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../../profiles/common - ../../profiles/desktop - ../../profiles/xfce - ../../profiles/network - ../../profiles/yubikey - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../profiles/common + ../../profiles/desktop + ../../profiles/xfce + ../../profiles/network + ../../profiles/yubikey + ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - + networking.hostName = "litha"; networking.useDHCP = false; networking.interfaces.enp34s0.useDHCP = true; system.stateVersion = "20.09"; - + } diff --git a/configuration/hosts/litha/hardware-configuration.nix b/configuration/hosts/litha/hardware-configuration.nix index 84cb0feb..43ec6ed0 100644 --- a/configuration/hosts/litha/hardware-configuration.nix +++ b/configuration/hosts/litha/hardware-configuration.nix @@ -4,28 +4,26 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/fa06ba90-ffc9-4ca6-b1cf-1205340a975e"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/fa06ba90-ffc9-4ca6-b1cf-1205340a975e"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/BF39-2AA3"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/BF39-2AA3"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/9c88235e-9705-4b80-a988-e95eda06124f"; } - ]; + [{ device = "/dev/disk/by-uuid/9c88235e-9705-4b80-a988-e95eda06124f"; }]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/configuration/hosts/samhain/configuration.nix b/configuration/hosts/samhain/configuration.nix index 2ac5e960..b2bbe5f3 100644 --- a/configuration/hosts/samhain/configuration.nix +++ b/configuration/hosts/samhain/configuration.nix @@ -1,34 +1,27 @@ { config, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ../../profiles/common - ../../profiles/desktop - ../../profiles/gnome - ../../profiles/gaming - ../../profiles/development - ../../profiles/network - ../../profiles/yubikey - ]; + imports = [ + ./hardware-configuration.nix + ../../profiles/common + ../../profiles/desktop + ../../profiles/gnome + ../../profiles/gaming + ../../profiles/development + ../../profiles/network + ../../profiles/yubikey + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - home-manager.users.kat = { - imports = [ - ./dconf.nix - ]; - }; - networking.hostName = "samhain"; - networking.hostId = "617050fc"; - + networking.hostId = "617050fc"; + networking.useDHCP = false; networking.interfaces.enp34s0.useDHCP = true; system.stateVersion = "20.09"; - + } diff --git a/configuration/hosts/samhain/dconf.nix b/configuration/hosts/samhain/dconf.nix deleted file mode 100644 index 849d601f..00000000 --- a/configuration/hosts/samhain/dconf.nix +++ /dev/null @@ -1,143 +0,0 @@ -# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix -{ lib, ... }: - -let - mkTuple = lib.hm.gvariant.mkTuple; -in -{ - dconf.settings = { - "org/gnome/control-center" = { - "last-panel" = "network"; - }; - - "org/gnome/desktop/input-sources" = { - "current" = "uint32 0"; - "sources" = [ (mkTuple [ "xkb" "gb" ]) ]; - "xkb-options" = [ "terminate:ctrl_alt_bksp" ]; - }; - - "org/gnome/desktop/interface" = { - "clock-show-seconds" = true; - "clock-show-weekday" = true; - "enable-hot-corners" = false; - "gtk-im-module" = "gtk-im-context-simple"; - }; - - "org/gnome/desktop/notifications" = { - "application-children" = [ "im-dino-dino" "telegramdesktop" "discord" "mumble" "firefox" ]; - }; - - "org/gnome/desktop/notifications/application/discord" = { - "application-id" = "discord.desktop"; - }; - - "org/gnome/desktop/notifications/application/firefox" = { - "application-id" = "firefox.desktop"; - }; - - "org/gnome/desktop/notifications/application/im-dino-dino" = { - "application-id" = "im.dino.Dino.desktop"; - }; - - "org/gnome/desktop/notifications/application/mumble" = { - "application-id" = "mumble.desktop"; - }; - - "org/gnome/desktop/notifications/application/telegramdesktop" = { - "application-id" = "telegramdesktop.desktop"; - }; - - "org/gnome/desktop/privacy" = { - "report-technical-problems" = true; - }; - - "org/gnome/desktop/wm/keybindings" = { - "panel-main-menu" = [ "F1" ]; - }; - - "org/gnome/desktop/wm/preferences" = { - "button-layout" = "appmenu:minimize,maximize,close"; - }; - - "org/gnome/evolution-data-server" = { - "migrated" = true; - "network-monitor-gio-name" = ""; - }; - - "org/gnome/mutter" = { - "attach-modal-dialogs" = true; - "dynamic-workspaces" = true; - "edge-tiling" = true; - "focus-change-on-pointer-rest" = true; - "overlay-key" = "Super_L"; - "workspaces-only-on-primary" = true; - }; - - "org/gnome/nautilus/preferences" = { - "default-folder-viewer" = "icon-view"; - "search-filter-time-type" = "last_modified"; - }; - - "org/gnome/nautilus/window-state" = { - "initial-size" = mkTuple [ 890 550 ]; - "maximized" = false; - }; - - "org/gnome/settings-daemon/plugins/color" = { - #"night-light-last-coordinates" = mkTuple [ 51.579800719942405 -2.47e-2 ]; - }; - - "org/gnome/settings-daemon/plugins/xsettings" = { - "antialiasing" = "grayscale"; - "hinting" = "slight"; - }; - - "org/gnome/shell" = { - "disabled-extensions" = "@as []"; - "enabled-extensions" = [ "arc-menu@linxgem33.com" "caffeine@patapon.info" "dash-to-panel@jderose9.github.com" "emoji-selector@maestroschan.fr" "appindicatorsupport@rgcjonas.gmail.com" ]; - }; - - "org/gnome/shell/extensions/arc-menu" = { - "arc-menu-icon" = 3; - "dtp-dtd-state" = [ true false ]; - "menu-button-icon" = "Arc_Menu_Icon"; - "menu-hotkey" = "Super_L"; - "pinned-app-list" = [ "Firefox" "firefox" "firefox.desktop" "Terminal" "utilities-terminal" "org.gnome.Terminal.desktop" "Arc Menu Settings" "ArcMenu_ArcMenuIcon" "gnome-extensions prefs arc-menu@linxgem33.com" ]; - }; - - "org/gnome/shell/extensions/dash-to-panel" = { - "available-monitors" = [ 1 0 2 ]; - "group-apps" = false; - "hotkeys-overlay-combo" = "TEMPORARILY"; - "multi-monitors" = false; - #"panel-element-positions" = "'{"0":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}],"1":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}],"2":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}]}'"; - #"panel-positions" = "'{"0":"TOP","1":"TOP","2":"TOP"}'"; - "panel-size" = 32; - "primary-monitor" = 1; - }; - - "org/gnome/shell/world-clocks" = { - "locations" = "@av []"; - }; - - "org/gnome/system/location" = { - "enabled" = true; - }; - - "org/gtk/settings/file-chooser" = { - "date-format" = "regular"; - "location-mode" = "path-bar"; - "show-hidden" = false; - "show-size-column" = true; - "show-type-column" = true; - "sidebar-width" = 164; - "sort-column" = "name"; - "sort-directories-first" = false; - "sort-order" = "ascending"; - "type-format" = "category"; - "window-position" = mkTuple [ 358 907 ]; - "window-size" = mkTuple [ 1203 902 ]; - }; - - }; -} diff --git a/configuration/hosts/samhain/hardware-configuration.nix b/configuration/hosts/samhain/hardware-configuration.nix index 7cacf551..04ac3f57 100644 --- a/configuration/hosts/samhain/hardware-configuration.nix +++ b/configuration/hosts/samhain/hardware-configuration.nix @@ -4,32 +4,30 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "zroot/safe/root"; - fsType = "zfs"; - }; + fileSystems."/" = { + device = "zroot/safe/root"; + fsType = "zfs"; + }; - fileSystems."/home" = - { device = "zroot/safe/home"; - fsType = "zfs"; - }; + fileSystems."/home" = { + device = "zroot/safe/home"; + fsType = "zfs"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/50C3-BE99"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/50C3-BE99"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/88595373-9566-401b-8c9b-03bbc8314f1b"; } - ]; + [{ device = "/dev/disk/by-uuid/88595373-9566-401b-8c9b-03bbc8314f1b"; }]; } diff --git a/configuration/hosts/yule/configuration.nix b/configuration/hosts/yule/configuration.nix index 83faf480..9504796e 100644 --- a/configuration/hosts/yule/configuration.nix +++ b/configuration/hosts/yule/configuration.nix @@ -1,21 +1,20 @@ { config, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ../../profiles/common - ../../profiles/desktop - ../../profiles/gnome - ../../profiles/gaming - ../../profiles/development - ../../profiles/network - ../../profiles/yubikey - ]; + imports = [ + ./hardware-configuration.nix + ../../profiles/common + ../../profiles/desktop + ../../profiles/gnome + ../../profiles/gaming + ../../profiles/development + ../../profiles/network + ../../profiles/yubikey + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - + networking.hostId = "dddbb888"; networking.hostName = "yule"; diff --git a/configuration/hosts/yule/hardware-configuration.nix b/configuration/hosts/yule/hardware-configuration.nix index 88d644b2..dbf2024a 100644 --- a/configuration/hosts/yule/hardware-configuration.nix +++ b/configuration/hosts/yule/hardware-configuration.nix @@ -4,33 +4,30 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "zpool/safe/root"; - fsType = "zfs"; - }; + fileSystems."/" = { + device = "zpool/safe/root"; + fsType = "zfs"; + }; - fileSystems."/home" = - { device = "zpool/safe/home"; - fsType = "zfs"; - }; + fileSystems."/home" = { + device = "zpool/safe/home"; + fsType = "zfs"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4683-4139"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4683-4139"; + fsType = "vfat"; + }; swapDevices = - [ { device = "/dev/disk/by-uuid/7e6f47fd-bedb-4012-8072-5e3a556e2f45"; } - ]; + [{ device = "/dev/disk/by-uuid/7e6f47fd-bedb-4012-8072-5e3a556e2f45"; }]; } - \ No newline at end of file diff --git a/configuration/profiles/common/default.nix b/configuration/profiles/common/default.nix index 405bd5ff..0169f555 100644 --- a/configuration/profiles/common/default.nix +++ b/configuration/profiles/common/default.nix @@ -1,36 +1,27 @@ { config, lib, pkgs, ... }: -let +let home-manager = fetchGit { url = "https://github.com/nix-community/home-manager"; rev = "a98ec6ec158686387d66654ea96153ec06be33d7"; }; in { - imports = [ - ../../../modules - "${home-manager}/nixos" - ./pbb.nix - ./users.nix - ]; + imports = [ ../../../modules "${home-manager}/nixos" ./pbb.nix ./users.nix ]; - nixpkgs.overlays = [ - (self: super: import ../../../pkgs { nixpkgs = super.path; }) - ]; + nixpkgs.overlays = + [ (self: super: import ../../../pkgs { nixpkgs = super.path; }) ]; boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; #boot.kernelParams = [ "quiet" ]; - nixpkgs.config = { - allowUnfree = true; - }; - + nixpkgs.config = { allowUnfree = true; }; + services.journald.extraConfig = "SystemMaxUse=512M"; nix.gc.automatic = lib.mkDefault true; nix.gc.options = lib.mkDefault "--delete-older-than 1w"; nix.trustedUsers = [ "root" "@wheel" ]; environment.variables.EDITOR = "neovim"; - services.openssh.enable = true; services.openssh.ports = lib.mkDefault [ 62954 ]; services.openssh.passwordAuthentication = false; @@ -38,7 +29,6 @@ in { services.openssh.permitRootLogin = lib.mkDefault "prohibit-password"; services.openssh.extraConfig = "StreamLocalBindUnlink yes"; security.sudo.wheelNeedsPassword = lib.mkForce false; - i18n.defaultLocale = "en_GB.UTF-8"; time.timeZone = "Europe/London"; @@ -48,15 +38,15 @@ in { }; environment.systemPackages = with pkgs; [ - smartmontools - lm_sensors - htop + smartmontools + lm_sensors + htop neovim ripgrep - git + git wget - rsync - pv + rsync + pv progress bc zstd diff --git a/configuration/profiles/common/pbb.nix b/configuration/profiles/common/pbb.nix index 34b9892f..f0ebb9fc 100644 --- a/configuration/profiles/common/pbb.nix +++ b/configuration/profiles/common/pbb.nix @@ -4,10 +4,7 @@ let rev = "4b0275db7842fda45dcc007d87b6274c4e63382b"; }; in { - imports = [ - "${pbbNixfiles}/modules" - ]; - nixpkgs.overlays = [ - (self: super: import "${pbbNixfiles}/pkgs" { nixpkgs = super.path; }) - ]; + imports = [ "${pbbNixfiles}/modules" ]; + nixpkgs.overlays = + [ (self: super: import "${pbbNixfiles}/pkgs" { nixpkgs = super.path; }) ]; } diff --git a/configuration/profiles/common/users.nix b/configuration/profiles/common/users.nix index 65f7286f..2d4c40f3 100644 --- a/configuration/profiles/common/users.nix +++ b/configuration/profiles/common/users.nix @@ -2,7 +2,12 @@ { users.users.root = { - openssh.authorizedKeys.keys = with pkgs.lib; concatLists (mapAttrsToList (name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else []) config.users.users); + openssh.authorizedKeys.keys = with pkgs.lib; + concatLists (mapAttrsToList (name: user: + if elem "wheel" user.extraGroups then + user.openssh.authorizedKeys.keys + else + [ ]) config.users.users); }; users.users.kat = { @@ -17,23 +22,19 @@ home-manager.useGlobalPkgs = true; home-manager.users.kat = { - programs.firefox = { - enable = true; - }; + programs.firefox = { enable = true; }; programs.fish = { enable = true; - plugins = [ - { - name = "bass"; - src = pkgs.fetchFromGitHub { - owner = "edc"; - repo = "bass"; - rev = "d63054b24c2f63aaa3a08fb9ec9d0da4c70ab922"; - sha256 = "0pwci5xxm8308nrb52s5nyxijk0svar8nqrdfvkk2y34z1cg319b"; - }; - } - ]; + plugins = [{ + name = "bass"; + src = pkgs.fetchFromGitHub { + owner = "edc"; + repo = "bass"; + rev = "d63054b24c2f63aaa3a08fb9ec9d0da4c70ab922"; + sha256 = "0pwci5xxm8308nrb52s5nyxijk0svar8nqrdfvkk2y34z1cg319b"; + }; + }]; }; programs.starship = { @@ -47,9 +48,7 @@ userEmail = "me@dork.dev"; }; - programs.kakoune = { - enable = true; - }; + programs.kakoune = { enable = true; }; programs.ssh = { enable = true; @@ -60,27 +59,20 @@ kat = { forwardAgent = true; extraOptions = { - RemoteForward = "/run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra"; + RemoteForward = + "/run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra"; }; port = 62954; }; in { - "beltane" = { - hostname = "beltane.dork.dev"; - } // kat; - "samhain" = { - hostname = "192.168.1.135"; - } // kat; - "litha" = { - hostname = "192.168.1.240"; - } // kat; - "yule" = { - hostname = "192.168.1.92"; - } // kat; + "beltane" = { hostname = "beltane.dork.dev"; } // kat; + "samhain" = { hostname = "192.168.1.135"; } // kat; + "litha" = { hostname = "192.168.1.240"; } // kat; + "yule" = { hostname = "192.168.1.92"; } // kat; }; }; programs.bat.enable = true; programs.tmux.enable = true; }; -} \ No newline at end of file +} diff --git a/configuration/profiles/desktop/default.nix b/configuration/profiles/desktop/default.nix index df5c2d5a..291a9d37 100644 --- a/configuration/profiles/desktop/default.nix +++ b/configuration/profiles/desktop/default.nix @@ -1,9 +1,10 @@ { config, lib, pkgs, ... }: -let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/master.tar.gz ) {}; in { - nixpkgs.config = { - mumble.speechdSupport = true; - }; +let + unstable = import + (fetchTarball "https://github.com/NixOS/nixpkgs/archive/master.tar.gz") { }; +in { + nixpkgs.config = { mumble.speechdSupport = true; }; home-manager.users.kat = { home.packages = [ @@ -46,10 +47,7 @@ let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/ma }; fonts.fontconfig.enable = true; - fonts.fonts = [ - pkgs.nerdfonts - pkgs.corefonts - ]; + fonts.fonts = [ pkgs.nerdfonts pkgs.corefonts ]; sound.enable = true; hardware.pulseaudio.enable = true; diff --git a/configuration/profiles/development/default.nix b/configuration/profiles/development/default.nix index b0799eb0..d4152353 100644 --- a/configuration/profiles/development/default.nix +++ b/configuration/profiles/development/default.nix @@ -1,20 +1,16 @@ - -{ config, lib, pkgs, ... }: -{ - environment.systemPackages = [ - pkgs.php - pkgs.php74Packages.composer2 - ]; +{ config, lib, pkgs, ... }: { + environment.systemPackages = [ pkgs.php pkgs.php74Packages.composer2 ]; home-manager.users.kat = { home.packages = [ - pkgs.jetbrains.clion - pkgs.jetbrains.idea-ultimate - pkgs.jetbrains.goland - pkgs.jetbrains.phpstorm - pkgs.carnix - pkgs.rustc - pkgs.cargo + pkgs.jetbrains.clion + pkgs.jetbrains.idea-ultimate + pkgs.jetbrains.goland + pkgs.jetbrains.phpstorm + pkgs.nixfmt + pkgs.carnix + pkgs.rustc + pkgs.cargo ]; }; -} \ No newline at end of file +} diff --git a/configuration/profiles/gaming/default.nix b/configuration/profiles/gaming/default.nix index ecf34b39..d9e8bf15 100644 --- a/configuration/profiles/gaming/default.nix +++ b/configuration/profiles/gaming/default.nix @@ -1,14 +1,7 @@ - -{ config, lib, pkgs, ... }: -{ +{ config, lib, pkgs, ... }: { hardware.opengl.driSupport32Bit = true; hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; hardware.pulseaudio.support32Bit = true; - - home-manager.users.kat = { - home.packages = [ - pkgs.steam - pkgs.steam-run - ]; - }; -} \ No newline at end of file + + home-manager.users.kat = { home.packages = [ pkgs.steam pkgs.steam-run ]; }; +} diff --git a/configuration/profiles/gnome/default.nix b/configuration/profiles/gnome/default.nix index f45c8518..40e31f13 100644 --- a/configuration/profiles/gnome/default.nix +++ b/configuration/profiles/gnome/default.nix @@ -1,21 +1,19 @@ - -{ config, lib, pkgs, ... }: -{ +{ config, lib, pkgs, ... }: { services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome3.enable = true; home-manager.users.kat = { home.packages = [ - pkgs.dconf2nix - pkgs.gnome3.gnome-tweak-tool - pkgs.gnomeExtensions.caffeine - pkgs.gnomeExtensions.emoji-selector - pkgs.gnomeExtensions.gsconnect - pkgs.gnomeExtensions.dash-to-panel - pkgs.gnomeExtensions.appindicator - pkgs.gnomeExtensions.dash-to-dock - pkgs.gnomeExtensions.arc-menu + pkgs.dconf2nix + pkgs.gnome3.gnome-tweak-tool + pkgs.gnomeExtensions.caffeine + pkgs.gnomeExtensions.emoji-selector + pkgs.gnomeExtensions.gsconnect + pkgs.gnomeExtensions.dash-to-panel + pkgs.gnomeExtensions.appindicator + pkgs.gnomeExtensions.dash-to-dock + pkgs.gnomeExtensions.arc-menu ]; }; @@ -23,4 +21,4 @@ enable = true; package = pkgs.gnome3.gvfs; }; -} \ No newline at end of file +} diff --git a/configuration/profiles/network/default.nix b/configuration/profiles/network/default.nix index 1cabaac3..7d8ad621 100644 --- a/configuration/profiles/network/default.nix +++ b/configuration/profiles/network/default.nix @@ -1,33 +1,41 @@ +{ config, lib, pkgs, ... }: { + networking = { + networkmanager.enable = true; + resolvconf.useLocalResolver = true; + networkmanager.dns = "none"; + }; -{ config, lib, pkgs, ... }: -{ - networking = { - networkmanager.enable = true; - resolvconf.useLocalResolver = true; - networkmanager.dns = "none"; + services.dnscrypt-proxy2 = { + enable = true; + settings = { + ipv6_servers = true; + require_dnssec = true; + + sources.public-resolvers = { + urls = [ + "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md" + "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" + ]; + cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; + minisign_key = + "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; + }; + + # You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v2/public-resolvers.md + server_names = [ + "acsacsar-ams-ipv4" + "acsacsar-ams-ipv6" + "dnscrypt.eu-dk" + "dnscrypt.eu-dk-ipv6" + "dnscrypt.eu-nl" + "dnscrypt.eu-nl-ipv6" + "meganerd" + "meganerd-ipv6" + ]; }; + }; - services.dnscrypt-proxy2 = { - enable = true; - settings = { - ipv6_servers = true; - require_dnssec = true; - - sources.public-resolvers = { - urls = [ - "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md" - "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" - ]; - cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; - minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; - }; - - # You can choose a specific set of servers from https://github.com/DNSCrypt/dnscrypt-resolvers/blob/master/v2/public-resolvers.md - server_names = [ "acsacsar-ams-ipv4" "acsacsar-ams-ipv6" "dnscrypt.eu-dk" "dnscrypt.eu-dk-ipv6" "dnscrypt.eu-nl" "dnscrypt.eu-nl-ipv6" "meganerd" "meganerd-ipv6" ]; - }; - }; - - systemd.services.dnscrypt-proxy2.serviceConfig = { - StateDirectory = "dnscrypt-proxy2"; - }; -} \ No newline at end of file + systemd.services.dnscrypt-proxy2.serviceConfig = { + StateDirectory = "dnscrypt-proxy2"; + }; +} diff --git a/configuration/profiles/xfce/default.nix b/configuration/profiles/xfce/default.nix index 3cf63eb1..24250080 100644 --- a/configuration/profiles/xfce/default.nix +++ b/configuration/profiles/xfce/default.nix @@ -1,6 +1,4 @@ - -{ config, lib, pkgs, ... }: -{ +{ config, lib, pkgs, ... }: { services.xserver.enable = true; services.xserver.displayManager.lightdm.enable = true; services.xserver.desktopManager.xfce.enable = true; @@ -9,7 +7,7 @@ package = lib.mkForce pkgs.gnome3.gvfs; }; - home-manager.users.kat = { + home-manager.users.kat = { home.packages = [ pkgs.xfce.xfce4-terminal pkgs.xfce.thunar @@ -20,5 +18,5 @@ pkgs.xfce.xfce4-whiskermenu-plugin pkgs.xfce.xfce4-screenshooter ]; - }; -} \ No newline at end of file + }; +} diff --git a/configuration/profiles/yubikey/default.nix b/configuration/profiles/yubikey/default.nix index c1bf0cc2..d24aec07 100644 --- a/configuration/profiles/yubikey/default.nix +++ b/configuration/profiles/yubikey/default.nix @@ -1,12 +1,10 @@ +{ config, lib, pkgs, ... }: { + services.pcscd.enable = true; + services.udev.packages = [ pkgs.yubikey-personalization ]; -{ config, lib, pkgs, ... }: -{ - services.pcscd.enable = true; - services.udev.packages = [ pkgs.yubikey-personalization ]; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - pinentryFlavor = "curses"; - }; -} \ No newline at end of file + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryFlavor = "curses"; + }; +} diff --git a/lib/deploy.nix b/lib/deploy.nix index ba947f17..3b193479 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -1,34 +1,27 @@ - let - pkgs = import {}; - lib = pkgs.lib; +let + pkgs = import { }; + lib = pkgs.lib; - hosts = import ../configuration/hosts; - nixosHosts = lib.filterAttrs (name: host: host ? ssh) hosts; + hosts = import ../configuration/hosts; + nixosHosts = lib.filterAttrs (name: host: host ? ssh) hosts; - allGroups = lib.unique ( - lib.flatten ( - lib.mapAttrsToList ( - name: host: host.groups - ) hosts - ) - ); + allGroups = lib.unique + (lib.flatten (lib.mapAttrsToList (name: host: host.groups) hosts)); - hostsInGroup = group: - lib.filterAttrs ( - k: v: builtins.elem group v.groups - ) hosts; + hostsInGroup = group: + lib.filterAttrs (k: v: builtins.elem group v.groups) hosts; - hostsInAllGroups = lib.listToAttrs ( - map ( - group: lib.nameValuePair group ( - lib.attrNames (hostsInGroup group) - ) - ) allGroups ); + hostsInAllGroups = lib.listToAttrs + (map (group: lib.nameValuePair group (lib.attrNames (hostsInGroup group))) + allGroups); - mkDeploy = hostnames: pkgs.writeScript "deploy-${lib.concatStringsSep "-" hostnames}" '' - #!${pkgs.stdenv.shell} - set -e -o pipefail - export PATH=/run/wrappers/bin/:${with pkgs; lib.makeBinPath [ + mkDeploy = hostnames: + pkgs.writeScript "deploy-${lib.concatStringsSep "-" hostnames}" '' + #!${pkgs.stdenv.shell} + set -e -o pipefail + export PATH=/run/wrappers/bin/:${ + with pkgs; + lib.makeBinPath [ coreutils openssh nix @@ -37,21 +30,24 @@ nettools gzip git - ]} + ] + } - MODE=$1 - shift || true - ARGS=$@ + MODE=$1 + shift || true + ARGS=$@ - [ "$MODE" == "" ] && MODE="switch" + [ "$MODE" == "" ] && MODE="switch" - ${lib.concatMapStrings (hostname: let + ${lib.concatMapStrings (hostname: + let hostAttrs = nixosHosts.${hostname}; nixosSystem = (import { modules = [ "${toString ../configuration}/hosts/${hostname}/configuration.nix" ]; - system = if hostAttrs ? system then hostAttrs.system else "x86_64-linux"; + system = + if hostAttrs ? system then hostAttrs.system else "x86_64-linux"; }).config.system.build.toplevel; in '' ( @@ -63,14 +59,16 @@ PID_LIST+=" $!" '') hostnames} - echo "deploys started, waiting for them to finish..." + echo "deploys started, waiting for them to finish..." - trap "kill $PID_LIST" SIGINT - wait $PID_LIST - ''; + trap "kill $PID_LIST" SIGINT + wait $PID_LIST + ''; - in { - deploy = (lib.mapAttrs (hostname: hostAttrs: mkDeploy [ hostname ]) nixosHosts) - // (lib.mapAttrs (group: hosts: mkDeploy hosts) hostsInAllGroups) - // { all = mkDeploy (lib.attrNames nixosHosts); }; - } +in { + deploy = + (lib.mapAttrs (hostname: hostAttrs: mkDeploy [ hostname ]) nixosHosts) + // (lib.mapAttrs (group: hosts: mkDeploy hosts) hostsInAllGroups) // { + all = mkDeploy (lib.attrNames nixosHosts); + }; +} diff --git a/modules/default.nix b/modules/default.nix index fca5958a..adc92a0c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,5 @@ { ... }: { - imports = [ - ]; + imports = [ ]; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 43897628..e6b3d541 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,10 +1,9 @@ { nixpkgs ? , ... }: let - pkgs = import nixpkgs {}; + pkgs = import nixpkgs { }; callPackage = pkgs.lib.callPackageWith (pkgs // newpkgs); - newpkgs = { - }; + newpkgs = { }; in newpkgs