From a9dd4ce7920654b6a409e6b446458e798361aa18 Mon Sep 17 00:00:00 2001 From: Eric Tossell Date: Wed, 27 Mar 2024 12:10:31 -0400 Subject: [PATCH 1/2] Flake update, btrfs, arkhitekton --- .github/workflows/flake_check.yml | 6 +- assets/default.nix | 7 +- default.nix | 3 +- flake.lock | 110 +++++++----- flake.nix | 161 ++++++++++-------- hosts/{principium => arkhitekton}/default.nix | 0 hosts/arkhitekton/hardware-configuration.nix | 85 +++++++++ hosts/default.nix | 9 +- hosts/live-image/default.nix | 7 +- hosts/live-image/virtualbox.nix | 6 +- hosts/principium/hardware-configuration.nix | 45 ----- hosts/terminus/default.nix | 7 +- hosts/terminus/hardware-configuration.nix | 23 ++- hosts/{virtualis => vm-temp}/default.nix | 3 +- hosts/{ambiens => vm}/default.nix | 8 +- .../hardware-configuration.nix | 20 ++- hosts/winix/default.nix | 8 +- minimal.nix | 3 +- modules/agenix/default.nix | 3 +- modules/apps/1password/default.nix | 10 +- modules/apps/browsing/default.nix | 12 +- modules/apps/default.nix | 8 +- modules/apps/libreoffice/default.nix | 3 +- modules/apps/obs/default.nix | 9 +- modules/apps/obsidian/default.nix | 12 +- modules/apps/vscode/default.nix | 14 +- modules/apps/zathura/default.nix | 12 +- modules/core/boot/systemd/default.nix | 2 +- modules/core/default.nix | 9 +- modules/core/nix/default.nix | 13 +- modules/core/security/default.nix | 9 +- modules/core/security/gnupg/default.nix | 1 - modules/core/security/polkit/default.nix | 4 +- modules/core/security/yubico/default.nix | 3 +- modules/core/terminal/bash/default.nix | 12 +- modules/core/terminal/cava/default.nix | 9 +- modules/core/terminal/cava/dots/default.nix | 4 +- modules/core/terminal/default.nix | 18 +- .../fonts/MplusCodeNerdFont/default.nix | 7 +- modules/core/terminal/fonts/default.nix | 13 +- modules/core/terminal/foot/default.nix | 9 +- modules/core/terminal/foot/dots/default.nix | 3 +- modules/core/terminal/nvim/default.nix | 3 +- modules/core/terminal/starship/default.nix | 100 ++++++++--- modules/core/terminal/tmux/default.nix | 9 +- modules/default.nix | 11 +- modules/eriixpkgs/default.nix | 8 +- modules/eriixpkgs/go-time/default.nix | 6 +- modules/eriixpkgs/homepage-nix/default.nix | 8 +- modules/eriixpkgs/russh/default.nix | 3 +- modules/gnome/default.nix | 45 +++-- modules/hardware/audio/default.nix | 7 +- modules/hardware/bluetooth/default.nix | 1 - modules/hardware/default.nix | 9 +- modules/hardware/network/default.nix | 7 +- modules/hardware/nvidia/default.nix | 59 ++++--- modules/hyprland/config/default.nix | 13 +- modules/hyprland/config/desktop.nix | 6 +- modules/hyprland/config/laptop.nix | 6 +- modules/hyprland/default.nix | 21 ++- modules/hyprland/greetd/default.nix | 6 +- modules/hyprland/hyprlock/default.nix | 10 +- modules/hyprland/mako/default.nix | 8 +- modules/hyprland/swaylock/default.nix | 8 +- modules/hyprland/waybar/default.nix | 11 +- modules/hyprland/waybar/desktop.nix | 6 +- modules/hyprland/waybar/laptop.nix | 3 +- modules/hyprland/wofi/default.nix | 8 +- modules/ssh/default.nix | 3 +- modules/steam/default.nix | 7 +- modules/tailscale/default.nix | 8 +- modules/virt/default.nix | 4 +- modules/virt/docker.nix | 7 +- modules/virt/libvirt.nix | 8 +- modules/virt/podman.nix | 9 +- sh/btrfs-luks.nix | 70 ++++++++ sh/btrfs.nix | 55 ++++++ sh/btrfs.sh | 30 ++++ sh/clean.nix | 5 +- users/default.nix | 5 +- users/eriim/default.nix | 10 +- users/nixos/default.nix | 5 +- wsl.nix | 4 +- 83 files changed, 948 insertions(+), 374 deletions(-) rename hosts/{principium => arkhitekton}/default.nix (100%) create mode 100644 hosts/arkhitekton/hardware-configuration.nix delete mode 100644 hosts/principium/hardware-configuration.nix rename hosts/{virtualis => vm-temp}/default.nix (93%) rename hosts/{ambiens => vm}/default.nix (82%) rename hosts/{ambiens => vm}/hardware-configuration.nix (81%) create mode 100644 sh/btrfs-luks.nix create mode 100644 sh/btrfs.nix create mode 100644 sh/btrfs.sh diff --git a/.github/workflows/flake_check.yml b/.github/workflows/flake_check.yml index 8d7d8d8d..00474487 100644 --- a/.github/workflows/flake_check.yml +++ b/.github/workflows/flake_check.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v23 + uses: cachix/install-nix-action@v26 with: nix_path: nixpkgs=channel:nixos-unstable @@ -24,8 +24,8 @@ jobs: - name: Run Statix Lint run: statix fix - - name: Run Nix Format - run: nix fmt + # - name: Run Nix Format + # run: nix fmt - name: Nix Flake Check - Manual run: nix flake check diff --git a/assets/default.nix b/assets/default.nix index f20b0abb..93fbb013 100644 --- a/assets/default.nix +++ b/assets/default.nix @@ -1,5 +1,8 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { - home.file = { ".config/backgrounds".source = ./backgrounds; }; + home.file = { + ".config/backgrounds".source = ./backgrounds; + }; }; } diff --git a/default.nix b/default.nix index 7f0fc8ed..5c2bc348 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,5 @@ -{ home-manager, ... }: { +{ home-manager, ... }: +{ imports = [ home-manager.nixosModules.home-manager ./assets diff --git a/flake.lock b/flake.lock index 110c4664..864db4c3 100644 --- a/flake.lock +++ b/flake.lock @@ -32,11 +32,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1707830867, - "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", + "lastModified": 1712079060, + "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", "owner": "ryantm", "repo": "agenix", - "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", + "rev": "1381a759b205dff7a6818733118d02253340fd5e", "type": "github" }, "original": { @@ -82,11 +82,11 @@ "russh": "russh" }, "locked": { - "lastModified": 1711163063, - "narHash": "sha256-Owhn7dauXjYHUdzxgEnIYpb4RWQYYv1jdzCCR6ky0Rs=", + "lastModified": 1711844410, + "narHash": "sha256-aGa1FAAOzKPGQ6uThJZuTFIqJ7FuLCUw4cxg0XVD8XI=", "owner": "erictossell", "repo": "eriixpkgs", - "rev": "cbd9f863e4e94f25f2dddc7b7da52c22fc0f5e98", + "rev": "f9e7177107ecee90026c9621b05d9bc371068561", "type": "github" }, "original": { @@ -102,11 +102,11 @@ "nixvim": "nixvim" }, "locked": { - "lastModified": 1711163037, - "narHash": "sha256-VajIpCYXewMab8SSOBrfFZPeQOKSv3ZpjcTIacNkTNQ=", + "lastModified": 1711559397, + "narHash": "sha256-4IQ8iq/EWGQbmCxU9oqOOxyqdwwqMp58/iDrdPRFTGI=", "owner": "erictossell", "repo": "eriixvim", - "rev": "634df47930428bee0e10c8fbfd02775df303d537", + "rev": "729321128a872bccbe7320ba25a7b6708590cf4d", "type": "github" }, "original": { @@ -339,11 +339,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1705887679, - "narHash": "sha256-lPm2As+fctI1MwJaAb1Px8li4Yck9DTRt4Kzt+qb49k=", + "lastModified": 1711318104, + "narHash": "sha256-aEmUMpjHrnzqiPPd4hW/Adc3et2fCm+gWMx4ajFYLPo=", "owner": "erictossell", "repo": "go-time", - "rev": "d2e5a8c286fde94478e16a597bc78b6954e3b9a8", + "rev": "8c3f36400edb3fb5957c73610f1a311c21f6d98b", "type": "github" }, "original": { @@ -403,11 +403,11 @@ ] }, "locked": { - "lastModified": 1711133180, - "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", + "lastModified": 1712212014, + "narHash": "sha256-s+lbaf3nLRn1++/X2eXwY9mYCA/m9l8AvyG8beeOaXE=", "owner": "nix-community", "repo": "home-manager", - "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", + "rev": "7e91f2a0ba4b62b88591279d54f741a13e36245b", "type": "github" }, "original": { @@ -449,11 +449,11 @@ ] }, "locked": { - "lastModified": 1711035742, - "narHash": "sha256-5vvhCSUGG9TA2G1eIRgokuYizhRnZu0ZbcU1MXfHsUE=", + "lastModified": 1711466786, + "narHash": "sha256-sArxGyUBiCA1in+q6t0QqT+ZJiZ1PyBp7cNPKLmREM0=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "6a92473237f430399a417e1c2da9d7fcd4970086", + "rev": "d3876f34779cc03ee51e4aafc0d00a4f187c7544", "type": "github" }, "original": { @@ -473,11 +473,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1711152198, - "narHash": "sha256-wT8UTS22HIm+Sbkim+IMqESW9SP+EB0FAjroyPnAovY=", + "lastModified": 1712253037, + "narHash": "sha256-9Ej7MCILxOTzXcznI3mt7avKzbv9nKQXru2DLrSlK2E=", "owner": "hyprwm", "repo": "hyprland", - "rev": "0dfdb6678f5362fda449694639e8fee806ca1ae4", + "rev": "0569b9c30099be32f5e0d3b56a050059b9e5a8c1", "type": "github" }, "original": { @@ -546,11 +546,11 @@ ] }, "locked": { - "lastModified": 1710960526, - "narHash": "sha256-tt0UgVKWeLQ+tFzvqrm4uAZbzONwdGshpfiLHAQ1P2c=", + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "a2f39421144d42541c057be235154ce21b76c0f6", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", "type": "github" }, "original": { @@ -564,14 +564,15 @@ "nixpkgs": [ "hyprlock", "nixpkgs" - ] + ], + "systems": "systems_13" }, "locked": { - "lastModified": 1708212860, - "narHash": "sha256-nW3Zrhh9RJcMTvOcXAaKADnJM/g6tDf3121lJtTHnYo=", + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "11d5ccda071c153dfdc18ef65338956a51cef96a", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", "type": "github" }, "original": { @@ -586,14 +587,14 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_13" + "systems": "systems_14" }, "locked": { - "lastModified": 1711101603, - "narHash": "sha256-5/uA1LoIQ6BhvABbTy46w97vO+q5jcngZ4BOsJtKiXs=", + "lastModified": 1711884603, + "narHash": "sha256-y1Om75muuJcEoLd/FOYGIZ5/ja/Mc4iBX/9S7vWF0C8=", "owner": "hyprwm", "repo": "hyprlock", - "rev": "0db5afb9d618571048bc30958e10b1990130bbb4", + "rev": "071ebcefb9070e4397d75103f5f535b58dacf250", "type": "github" }, "original": { @@ -609,11 +610,11 @@ ] }, "locked": { - "lastModified": 1710274605, - "narHash": "sha256-N75WUOOVl6dI8N03++3qrNNgYg4pF5cSiWX2Z+Bp7KQ=", + "lastModified": 1711283076, + "narHash": "sha256-Cda+XbHpvyz3HhdJ7FlXFoaazOWtdBoOWmEaj4ZFwRM=", "owner": "hyprwm", "repo": "hyprpicker", - "rev": "0e416939a172f1ea5f367cdba1490479dd6d4aec", + "rev": "0eb49192a5cdd5e6e8e6c2c82c33857d78d6cd56", "type": "github" }, "original": { @@ -742,11 +743,11 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1711001935, - "narHash": "sha256-URtGpHue7HHZK0mrHnSf8wJ6OmMKYSsoLmJybrOLFSQ=", + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20f77aa09916374aa3141cbc605c955626762c9a", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", "type": "github" }, "original": { @@ -819,11 +820,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1710451336, - "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d691274a972b3165335d261cc4671335f5c67de9", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "type": "github" }, "original": { @@ -865,11 +866,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1711001935, - "narHash": "sha256-URtGpHue7HHZK0mrHnSf8wJ6OmMKYSsoLmJybrOLFSQ=", + "lastModified": 1711523803, + "narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20f77aa09916374aa3141cbc605c955626762c9a", + "rev": "2726f127c15a4cc9810843b96cad73c7eb39e443", "type": "github" }, "original": { @@ -968,11 +969,11 @@ "poetry2nix": "poetry2nix" }, "locked": { - "lastModified": 1710634317, - "narHash": "sha256-/NgxjIHtGBnugsBOtMn5RVEOuKWiDlOwfNVhkLPz8rY=", + "lastModified": 1711843955, + "narHash": "sha256-ip8KP9LPCnrx10Ndbt9xzi/WJAfztDf35nSdXrPbSKI=", "owner": "erictossell", "repo": "readme-py", - "rev": "13c2ab494487426c8d71e70d3d1a096efc0f662a", + "rev": "8c7da04705e2fa7aba761d0f9375af104d446cee", "type": "github" }, "original": { @@ -1088,6 +1089,21 @@ "type": "github" } }, + "systems_14": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 7c91efd6..b6b78ad2 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,9 @@ inputs.darwin.follows = ""; }; - hyprland = { url = "github:hyprwm/hyprland"; }; + hyprland = { + url = "github:hyprwm/hyprland"; + }; hyprlock = { url = "github:hyprwm/hyprlock"; @@ -38,90 +40,113 @@ }; }; - outputs = { self, nixpkgs, ... }@attrs: + outputs = + { self, nixpkgs, ... }@attrs: let supportedSystems = [ "x86_64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); - in { + in + { nixosConfigurations = { - principium = let system = "x86_64-linux"; - in nixpkgs.lib.nixosSystem { - specialArgs = { - username = "eriim"; - hostName = "principium"; - hyprlandConfig = "desktop"; - inherit system; - } // attrs; - modules = [ - ./. - ./modules/hardware/nvidia - ./modules/apps/obs - ./modules/steam - ./modules/virt - ]; - }; # principium - - live-image = let system = "x86_64-linux"; - in nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - username = "nixos"; - hostName = "live-image"; - hyprlandConfig = "laptop"; - inherit system; - } // attrs; - modules = [ ./minimal.nix ]; - }; # live-image - - winix = let system = "x86_64-linux"; - in nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - username = "eriim"; - hostName = "winix"; + arkhitekton = + let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { + specialArgs = { + username = "eriim"; + hostName = "arkhitekton"; + hyprlandConfig = "desktop"; + inherit system; + } // attrs; + modules = [ + ./. + ./modules/hardware/nvidia + ./modules/virt + ]; + }; # principium + + live-image = + let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { inherit system; - } // attrs; - modules = [ ./wsl.nix ]; - }; # winix-wsl - - virtualis = let system = "x86_64-linux"; - in nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - username = "eriim"; - hostName = "virtualis"; + specialArgs = { + username = "nixos"; + hostName = "live-image"; + hyprlandConfig = "laptop"; + inherit system; + } // attrs; + modules = [ ./minimal.nix ]; + }; # live-image + + winix = + let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { inherit system; - } // attrs; - modules = [ ./minimal.nix ]; - }; # virtualis - - terminus = let system = "x86_64-linux"; - in nixpkgs.lib.nixosSystem { - specialArgs = { - username = "eriim"; - hostName = "terminus"; - hyprlandConfig = "laptop"; + specialArgs = { + username = "eriim"; + hostName = "winix"; + inherit system; + } // attrs; + modules = [ ./wsl.nix ]; + }; # winix-wsl + + vm-temp = + let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { inherit system; - } // attrs; - modules = [ ./. ]; - }; # terminus + specialArgs = { + username = "eriim"; + hostName = "vm-temp"; + inherit system; + } // attrs; + modules = [ ./minimal.nix ]; + }; # virtualis + + terminus = + let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { + specialArgs = { + username = "eriim"; + hostName = "terminus"; + hyprlandConfig = "laptop"; + inherit system; + } // attrs; + modules = [ ./. ]; + }; # terminus }; # configurations - devShells = forAllSystems (system: - let pkgs = nixpkgsFor.${system}; - in { - default = - pkgs.mkShell { buildInputs = with pkgs; [ nixfmt statix ]; }; - }); + devShells = forAllSystems ( + system: + let + pkgs = nixpkgsFor.${system}; + in + { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + nixfmt + statix + ]; + }; + } + ); templates.default = { path = ./.; description = "The default template for Eriim's nixflakes."; }; # templates - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; }; } diff --git a/hosts/principium/default.nix b/hosts/arkhitekton/default.nix similarity index 100% rename from hosts/principium/default.nix rename to hosts/arkhitekton/default.nix diff --git a/hosts/arkhitekton/hardware-configuration.nix b/hosts/arkhitekton/hardware-configuration.nix new file mode 100644 index 00000000..f0b289c9 --- /dev/null +++ b/hosts/arkhitekton/hardware-configuration.nix @@ -0,0 +1,85 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/0959a069-0972-4c2f-b224-022fc6408357"; + fsType = "btrfs"; + options = [ + "subvol=root" + "compress=zstd" + "noatime" + ]; + }; + + boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/23171576-c555-45da-b1c2-ac3ea32912f9"; + + fileSystems."/.swapvol" = { + device = "/dev/disk/by-uuid/0959a069-0972-4c2f-b224-022fc6408357"; + fsType = "btrfs"; + options = [ + "subvol=swap" + "noatime" + ]; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7A64-9A6B"; + fsType = "vfat"; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/0959a069-0972-4c2f-b224-022fc6408357"; + fsType = "btrfs"; + options = [ + "subvol=home" + "compress=zstd" + "noatime" + ]; + }; + + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/0959a069-0972-4c2f-b224-022fc6408357"; + fsType = "btrfs"; + options = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + + swapDevices = [ { device = "/.swapvol/swapfile"; } ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/default.nix b/hosts/default.nix index 45fe08e5..8dc4dac2 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,7 @@ -{ hostName, ... }: { - imports = [ ./${hostName} ./internationalisation ]; - +{ hostName, ... }: +{ + imports = [ + ./${hostName} + ./internationalisation + ]; } diff --git a/hosts/live-image/default.nix b/hosts/live-image/default.nix index bd64cce2..a1918edc 100644 --- a/hosts/live-image/default.nix +++ b/hosts/live-image/default.nix @@ -1,8 +1,7 @@ # A simple host configuration for creating live images -{ nixpkgs, ... }: { - imports = [ - (nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") - ]; +{ nixpkgs, ... }: +{ + imports = [ (nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") ]; virtualisation.vmVariant = { virtualisation = { memorySize = 4096; diff --git a/hosts/live-image/virtualbox.nix b/hosts/live-image/virtualbox.nix index ab8c805e..58f2ebda 100644 --- a/hosts/live-image/virtualbox.nix +++ b/hosts/live-image/virtualbox.nix @@ -1,5 +1,5 @@ # A simple host configuration for creating live images -{ nixpkgs, ... }: { - imports = - [ (nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix") ]; +{ nixpkgs, ... }: +{ + imports = [ (nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix") ]; } diff --git a/hosts/principium/hardware-configuration.nix b/hosts/principium/hardware-configuration.nix deleted file mode 100644 index 4452dde6..00000000 --- a/hosts/principium/hardware-configuration.nix +++ /dev/null @@ -1,45 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot = { - initrd = { - availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - kernelModules = [ ]; - luks.devices."cryptroot".device = - "/dev/disk/by-uuid/9d250253-6546-420f-b7b5-6b72af3dd45d"; - }; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; - - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/78baeb2a-0686-4bce-a3e1-d1095265632b"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/2F4D-ACD4"; - fsType = "vfat"; - }; - - swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/terminus/default.nix b/hosts/terminus/default.nix index 0c6e16e4..d9193c53 100644 --- a/hosts/terminus/default.nix +++ b/hosts/terminus/default.nix @@ -1,8 +1,11 @@ { imports = [ ./hardware-configuration.nix ]; #----Host specific config ---- - boot.kernelParams = - [ "i8042.direct" "i8042.dumbkbd" "i915.force_probe=9a49" ]; + boot.kernelParams = [ + "i8042.direct" + "i8042.dumbkbd" + "i915.force_probe=9a49" + ]; # ---- System Configurations ---- powerManagement.powertop.enable = true; services.thermald.enable = true; diff --git a/hosts/terminus/hardware-configuration.nix b/hosts/terminus/hardware-configuration.nix index b4820a98..f7a4354e 100644 --- a/hosts/terminus/hardware-configuration.nix +++ b/hosts/terminus/hardware-configuration.nix @@ -1,13 +1,24 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = - [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -17,8 +28,7 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-b9405897-7acf-4c1a-a86f-c387d7679ae4".device = - "/dev/disk/by-uuid/b9405897-7acf-4c1a-a86f-c387d7679ae4"; + boot.initrd.luks.devices."luks-b9405897-7acf-4c1a-a86f-c387d7679ae4".device = "/dev/disk/by-uuid/b9405897-7acf-4c1a-a86f-c387d7679ae4"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/F633-2908"; @@ -36,6 +46,5 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/virtualis/default.nix b/hosts/vm-temp/default.nix similarity index 93% rename from hosts/virtualis/default.nix rename to hosts/vm-temp/default.nix index ad9c4400..3e3434f6 100644 --- a/hosts/virtualis/default.nix +++ b/hosts/vm-temp/default.nix @@ -1,5 +1,6 @@ # A simple host configuration for creating live images -{ nixpkgs, ... }: { +{ nixpkgs, ... }: +{ imports = [ (nixpkgs + "/nixos/modules/virtualisation/qemu-vm.nix") (nixpkgs + "/nixos/modules/virtualisation/qemu-guest-agent.nix") diff --git a/hosts/ambiens/default.nix b/hosts/vm/default.nix similarity index 82% rename from hosts/ambiens/default.nix rename to hosts/vm/default.nix index 15e5c991..c3bd567f 100644 --- a/hosts/ambiens/default.nix +++ b/hosts/vm/default.nix @@ -1,4 +1,5 @@ -{ nixpkgs, ... }: { +{ nixpkgs, ... }: +{ imports = [ (nixpkgs + "/nixos/modules/virtualisation/qemu-guest-agent.nix") ./hardware-configuration.nix @@ -11,12 +12,13 @@ enableCryptodisk = true; }; }; - boot.initrd.secrets = { "/crypto_keyfile.bin" = null; }; + boot.initrd.secrets = { + "/crypto_keyfile.bin" = null; + }; services = { spice-autorandr.enable = true; spice-vdagentd.enable = true; spice-webdavd.enable = true; }; - } diff --git a/hosts/ambiens/hardware-configuration.nix b/hosts/vm/hardware-configuration.nix similarity index 81% rename from hosts/ambiens/hardware-configuration.nix rename to hosts/vm/hardware-configuration.nix index ff4040a2..54443e23 100644 --- a/hosts/ambiens/hardware-configuration.nix +++ b/hosts/vm/hardware-configuration.nix @@ -1,18 +1,28 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot = { initrd = { - availableKernelModules = - [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; kernelModules = [ ]; - luks.devices."luks-d719ccb3-3478-4b82-a67a-c9e1286a727c".device = - "/dev/disk/by-uuid/d719ccb3-3478-4b82-a67a-c9e1286a727c"; + luks.devices."luks-d719ccb3-3478-4b82-a67a-c9e1286a727c".device = "/dev/disk/by-uuid/d719ccb3-3478-4b82-a67a-c9e1286a727c"; }; kernelModules = [ "kvm-amd" ]; extraModulePackages = [ ]; diff --git a/hosts/winix/default.nix b/hosts/winix/default.nix index d4588583..0b21a98d 100644 --- a/hosts/winix/default.nix +++ b/hosts/winix/default.nix @@ -1,4 +1,9 @@ -{ username, hostName, NixOS-WSL, ... }: +{ + username, + hostName, + NixOS-WSL, + ... +}: { imports = [ NixOS-WSL.nixosModules.wsl ]; @@ -9,5 +14,4 @@ }; networking.hostName = "${hostName}"; - } diff --git a/minimal.nix b/minimal.nix index 8ba114c7..8d0cd472 100644 --- a/minimal.nix +++ b/minimal.nix @@ -1,4 +1,5 @@ -{ home-manager, ... }: { +{ home-manager, ... }: +{ imports = [ home-manager.nixosModules.home-manager ./users diff --git a/modules/agenix/default.nix b/modules/agenix/default.nix index 26302fea..a17f972f 100644 --- a/modules/agenix/default.nix +++ b/modules/agenix/default.nix @@ -1,4 +1,5 @@ -{ agenix, system, ... }: { +{ agenix, system, ... }: +{ imports = [ agenix.nixosModules.default ]; environment.systemPackages = [ agenix.packages.${system}.default ]; } diff --git a/modules/apps/1password/default.nix b/modules/apps/1password/default.nix index 83414fb0..8812ff41 100644 --- a/modules/apps/1password/default.nix +++ b/modules/apps/1password/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ # home-manager.users.${username} = { @@ -45,6 +51,4 @@ # Enable 1password to open with gnomekeyring security.pam.services."1password".enableGnomeKeyring = true; - } - diff --git a/modules/apps/browsing/default.nix b/modules/apps/browsing/default.nix index 113bc802..628d4dfb 100644 --- a/modules/apps/browsing/default.nix +++ b/modules/apps/browsing/default.nix @@ -1,8 +1,16 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ #----- Home Manager Config ----- home-manager.users.${username} = { - home.sessionVariables = { MOZ_ENABLE_WAYLAND = 1; }; + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = 1; + }; programs = { #chromium = { diff --git a/modules/apps/default.nix b/modules/apps/default.nix index 0def9085..f1e6f415 100644 --- a/modules/apps/default.nix +++ b/modules/apps/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ imports = [ ./1password ./browsing diff --git a/modules/apps/libreoffice/default.nix b/modules/apps/libreoffice/default.nix index 96c6237b..de702517 100644 --- a/modules/apps/libreoffice/default.nix +++ b/modules/apps/libreoffice/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ libreoffice-qt hunspell diff --git a/modules/apps/obs/default.nix b/modules/apps/obs/default.nix index 41b689cd..8afbf879 100644 --- a/modules/apps/obs/default.nix +++ b/modules/apps/obs/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ home-manager.users.${username} = { programs = { obs-studio = { @@ -15,4 +21,3 @@ }; environment.systemPackages = with pkgs; [ obs-studio ]; } - diff --git a/modules/apps/obsidian/default.nix b/modules/apps/obsidian/default.nix index f35c902c..f15b1dfb 100644 --- a/modules/apps/obsidian/default.nix +++ b/modules/apps/obsidian/default.nix @@ -1,5 +1,13 @@ -{ pkgs, home-manager, username, ... }: { - home-manager.users.${username} = { home.packages = with pkgs; [ obsidian ]; }; +{ + pkgs, + home-manager, + username, + ... +}: +{ + home-manager.users.${username} = { + home.packages = with pkgs; [ obsidian ]; + }; nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ]; } diff --git a/modules/apps/vscode/default.nix b/modules/apps/vscode/default.nix index e18855de..715a017d 100644 --- a/modules/apps/vscode/default.nix +++ b/modules/apps/vscode/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ home-manager.users.${username} = { # VS Code on Wayland has issues, make sure to set the title bar to custom # https://github.com/microsoft/vscode/issues/181533 @@ -19,16 +25,14 @@ userSettings = { "window.titleBarStyle" = "custom"; "workbench.colorTheme" = "Github Dark Colorblind (Beta)"; - "editor.fontFamily" = - "'M+1Code Nerd Font','Droid Sans Mono', 'monospace', monospace"; + "editor.fontFamily" = "'M+1Code Nerd Font','Droid Sans Mono', 'monospace', monospace"; "github.copilot.enable" = { "*" = true; "plaintext" = false; "markdown" = true; "scminput" = false; }; - "powershell.powerShellAdditionalExePaths" = - "/run/current-system/sw/bin/pwsh"; + "powershell.powerShellAdditionalExePaths" = "/run/current-system/sw/bin/pwsh"; }; }; }; diff --git a/modules/apps/zathura/default.nix b/modules/apps/zathura/default.nix index f3dea33d..9bd6a1e7 100644 --- a/modules/apps/zathura/default.nix +++ b/modules/apps/zathura/default.nix @@ -1,3 +1,11 @@ -{ pkgs, home-manager, username, ... }: { - home-manager.users.${username} = { home.packages = with pkgs; [ zathura ]; }; +{ + pkgs, + home-manager, + username, + ... +}: +{ + home-manager.users.${username} = { + home.packages = with pkgs; [ zathura ]; + }; } diff --git a/modules/core/boot/systemd/default.nix b/modules/core/boot/systemd/default.nix index db6c36ef..d880dd8d 100644 --- a/modules/core/boot/systemd/default.nix +++ b/modules/core/boot/systemd/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ # Bootloader. boot.loader = { systemd-boot.enable = true; diff --git a/modules/core/default.nix b/modules/core/default.nix index 7eb08005..d3544ea5 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1 +1,8 @@ -{ imports = [ ./boot/systemd ./nix ./security ./terminal ]; } +{ + imports = [ + ./boot/systemd + ./nix + ./security + ./terminal + ]; +} diff --git a/modules/core/nix/default.nix b/modules/core/nix/default.nix index 4f195e7b..f9c65117 100644 --- a/modules/core/nix/default.nix +++ b/modules/core/nix/default.nix @@ -1,4 +1,10 @@ -{ home-manager, pkgs, username, ... }: { +{ + home-manager, + pkgs, + username, + ... +}: +{ # https://github.com/lovesegfault/nix-config/blob/e412cd01cda084c7e3f5c1fbcf7d99665999949e/core/nixos.nix#L39 system = { extraSystemBuilderCmds = '' @@ -11,7 +17,10 @@ nix = { package = pkgs.nixVersions.nix_2_21; nixPath = [ "nixpkgs=/run/current-system/nixpkgs" ]; - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; }; home-manager.users.${username} = { diff --git a/modules/core/security/default.nix b/modules/core/security/default.nix index feaca045..389456a9 100644 --- a/modules/core/security/default.nix +++ b/modules/core/security/default.nix @@ -1,2 +1,7 @@ -{ imports = [ ./gnupg ./polkit ./yubico ]; } - +{ + imports = [ + ./gnupg + ./polkit + ./yubico + ]; +} diff --git a/modules/core/security/gnupg/default.nix b/modules/core/security/gnupg/default.nix index 7dc1020b..3ac32ea9 100644 --- a/modules/core/security/gnupg/default.nix +++ b/modules/core/security/gnupg/default.nix @@ -1,2 +1 @@ { programs.gnupg.agent.enable = true; } - diff --git a/modules/core/security/polkit/default.nix b/modules/core/security/polkit/default.nix index 03bce48b..423ea2e0 100644 --- a/modules/core/security/polkit/default.nix +++ b/modules/core/security/polkit/default.nix @@ -1,4 +1,5 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ security = { polkit = { enable = true; @@ -13,4 +14,3 @@ }; programs.gnupg.agent.enable = true; } - diff --git a/modules/core/security/yubico/default.nix b/modules/core/security/yubico/default.nix index 48caf80f..388db536 100644 --- a/modules/core/security/yubico/default.nix +++ b/modules/core/security/yubico/default.nix @@ -1,4 +1,5 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ security = { pam = { # Auth with FIDO Keys diff --git a/modules/core/terminal/bash/default.nix b/modules/core/terminal/bash/default.nix index 4556ffc1..ab39e5b5 100644 --- a/modules/core/terminal/bash/default.nix +++ b/modules/core/terminal/bash/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ # Shell Aliases inspired by: # https://github.com/donovanglover/nix-config # ---- System Configuration ---- @@ -73,8 +79,7 @@ nr = "nix run"; ncg = "sudo nix-collect-garbage -d"; sw = "sudo nixos-rebuild switch --flake ."; - vm = - "nixos-rebuild build-vm --flake . && ./result/bin/run-nixos-vm && trash put result nixos.qcow2"; + vm = "nixos-rebuild build-vm --flake . && ./result/bin/run-nixos-vm && trash put result nixos.qcow2"; ci = "cargo init"; cin = "cargo info"; @@ -96,5 +101,4 @@ py = "${pkgs.python312}/bin/python3"; }; }; - } diff --git a/modules/core/terminal/cava/default.nix b/modules/core/terminal/cava/default.nix index 0879aad5..48d870a4 100644 --- a/modules/core/terminal/cava/default.nix +++ b/modules/core/terminal/cava/default.nix @@ -1,5 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ imports = [ ./dots ]; environment.systemPackages = with pkgs; [ cava ]; - } diff --git a/modules/core/terminal/cava/dots/default.nix b/modules/core/terminal/cava/dots/default.nix index 754fe402..a8ad451b 100644 --- a/modules/core/terminal/cava/dots/default.nix +++ b/modules/core/terminal/cava/dots/default.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { ".config/cava/config".text = '' @@ -364,7 +365,6 @@ fragCoord = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; } ''; - }; }; } diff --git a/modules/core/terminal/default.nix b/modules/core/terminal/default.nix index d6c1707a..13289bb3 100644 --- a/modules/core/terminal/default.nix +++ b/modules/core/terminal/default.nix @@ -1,5 +1,19 @@ -{ pkgs, home-manager, username, ... }: { - imports = [ ./bash ./cava ./fonts ./foot ./nvim ./starship ./tmux ]; +{ + pkgs, + home-manager, + username, + ... +}: +{ + imports = [ + ./bash + ./cava + ./fonts + ./foot + ./nvim + ./starship + ./tmux + ]; # ---- Home Configuration ---- home-manager.users.${username} = { diff --git a/modules/core/terminal/fonts/MplusCodeNerdFont/default.nix b/modules/core/terminal/fonts/MplusCodeNerdFont/default.nix index fde87d4d..b4c7c5df 100644 --- a/modules/core/terminal/fonts/MplusCodeNerdFont/default.nix +++ b/modules/core/terminal/fonts/MplusCodeNerdFont/default.nix @@ -1,4 +1,8 @@ -{ stdenv, lib, pkgs }: +{ + stdenv, + lib, + pkgs, +}: stdenv.mkDerivation rec { pname = "M+1CodeNerdFont"; @@ -18,4 +22,3 @@ stdenv.mkDerivation rec { license = licenses.free; }; } - diff --git a/modules/core/terminal/fonts/default.nix b/modules/core/terminal/fonts/default.nix index d6efe6f9..f304fa00 100644 --- a/modules/core/terminal/fonts/default.nix +++ b/modules/core/terminal/fonts/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ fonts = { packages = with pkgs; [ (callPackage (import ./MplusCodeNerdFont) { }) @@ -9,8 +10,14 @@ roboto ]; fontconfig.defaultFonts = { - serif = [ "Roboto Serif" "Noto Color Emoji" ]; - sansSerif = [ "Roboto" "Noto Color Emoji" ]; + serif = [ + "Roboto Serif" + "Noto Color Emoji" + ]; + sansSerif = [ + "Roboto" + "Noto Color Emoji" + ]; emoji = [ "Noto Color Emoji" ]; }; }; diff --git a/modules/core/terminal/foot/default.nix b/modules/core/terminal/foot/default.nix index 0b077b4f..e2f1c63a 100644 --- a/modules/core/terminal/foot/default.nix +++ b/modules/core/terminal/foot/default.nix @@ -1,5 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ imports = [ ./dots ]; environment.systemPackages = with pkgs; [ foot ]; - } diff --git a/modules/core/terminal/foot/dots/default.nix b/modules/core/terminal/foot/dots/default.nix index 66e9f2be..e35bf244 100644 --- a/modules/core/terminal/foot/dots/default.nix +++ b/modules/core/terminal/foot/dots/default.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { ".config/foot/foot.ini".text = '' diff --git a/modules/core/terminal/nvim/default.nix b/modules/core/terminal/nvim/default.nix index 54508089..db24acf9 100644 --- a/modules/core/terminal/nvim/default.nix +++ b/modules/core/terminal/nvim/default.nix @@ -1,4 +1,5 @@ -{ eriixpkgs, system, ... }: { +{ eriixpkgs, system, ... }: +{ environment.variables.EDITOR = "nvim"; environment.systemPackages = [ eriixpkgs.packages.${system}.eriixvim ]; } diff --git a/modules/core/terminal/starship/default.nix b/modules/core/terminal/starship/default.nix index 54dd7489..3e6029c6 100644 --- a/modules/core/terminal/starship/default.nix +++ b/modules/core/terminal/starship/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ programs.starship = { enable = true; settings = { @@ -11,7 +17,9 @@ vimcmd_symbol = "[<](bold green)"; }; - git_commit = { tag_symbol = " tag "; }; + git_commit = { + tag_symbol = " tag "; + }; git_status = { ahead = ">"; behind = "<"; @@ -23,26 +31,54 @@ min_time = 500; format = "took [$duration](bold yellow)"; }; - aws = { symbol = "aws "; }; - azure = { symbol = "az "; }; - bun = { symbol = "bun "; }; + aws = { + symbol = "aws "; + }; + azure = { + symbol = "az "; + }; + bun = { + symbol = "bun "; + }; - cmake = { symbol = "cmake "; }; - deno = { symbol = "deno "; }; - directory = { read_only = " ro"; }; - docker_context = { symbol = "docker "; }; - git_branch = { symbol = "git "; }; - golang = { symbol = "go "; }; + cmake = { + symbol = "cmake "; + }; + deno = { + symbol = "deno "; + }; + directory = { + read_only = " ro"; + }; + docker_context = { + symbol = "docker "; + }; + git_branch = { + symbol = "git "; + }; + golang = { + symbol = "go "; + }; hostname = { ssh_only = false; format = " on [$hostname](bold red)\n"; disabled = false; }; - lua = { symbol = "lua "; }; - nodejs = { symbol = "nodejs "; }; - memory_usage = { symbol = "memory "; }; - nim = { symbol = "nim "; }; - nix_shell = { symbol = "nix "; }; + lua = { + symbol = "lua "; + }; + nodejs = { + symbol = "nodejs "; + }; + memory_usage = { + symbol = "memory "; + }; + nim = { + symbol = "nim "; + }; + nix_shell = { + symbol = "nix "; + }; os.symbols = { Alpaquita = "alq "; Alpine = "alp "; @@ -86,13 +122,27 @@ Unknown = "unk "; Windows = "win "; }; - package = { symbol = "pkg "; }; - purescript = { symbol = "purs "; }; - python = { symbol = "py "; }; - rust = { symbol = "rs "; }; - status = { symbol = "[x](bold red) "; }; - sudo = { symbol = "sudo "; }; - terraform = { symbol = "terraform "; }; + package = { + symbol = "pkg "; + }; + purescript = { + symbol = "purs "; + }; + python = { + symbol = "py "; + }; + rust = { + symbol = "rs "; + }; + status = { + symbol = "[x](bold red) "; + }; + sudo = { + symbol = "sudo "; + }; + terraform = { + symbol = "terraform "; + }; username = { style_user = "green bold"; style_root = "red bold"; @@ -100,7 +150,9 @@ disabled = false; show_always = true; }; - zig = { symbol = "zig "; }; + zig = { + symbol = "zig "; + }; }; }; } diff --git a/modules/core/terminal/tmux/default.nix b/modules/core/terminal/tmux/default.nix index 6788276a..9c4a3e70 100644 --- a/modules/core/terminal/tmux/default.nix +++ b/modules/core/terminal/tmux/default.nix @@ -1,12 +1,15 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ # ---- System Configuration ---- programs = { tmux = { enable = true; clock24 = true; newSession = true; - plugins = with pkgs.tmuxPlugins; [ catppuccin yank ]; + plugins = with pkgs.tmuxPlugins; [ + catppuccin + yank + ]; }; }; - } diff --git a/modules/default.nix b/modules/default.nix index f15843d9..fee8a7a4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,11 @@ { - imports = - [ ./agenix ./apps ./core ./eriixpkgs ./hardware ./hyprland ./tailscale ]; + imports = [ + ./agenix + ./apps + ./core + ./eriixpkgs + ./hardware + ./hyprland + ./tailscale + ]; } diff --git a/modules/eriixpkgs/default.nix b/modules/eriixpkgs/default.nix index 9fff22a8..8cced6cc 100644 --- a/modules/eriixpkgs/default.nix +++ b/modules/eriixpkgs/default.nix @@ -1 +1,7 @@ -{ imports = [ ./go-time ./homepage-nix ./russh ]; } +{ + imports = [ + ./go-time + ./homepage-nix + ./russh + ]; +} diff --git a/modules/eriixpkgs/go-time/default.nix b/modules/eriixpkgs/go-time/default.nix index d304df73..2e4a4188 100644 --- a/modules/eriixpkgs/go-time/default.nix +++ b/modules/eriixpkgs/go-time/default.nix @@ -1,4 +1,4 @@ -{ pkgs, eriixpkgs, ... }: { - environment.systemPackages = with pkgs; - [ eriixpkgs.packages.${system}.go-time ]; +{ pkgs, eriixpkgs, ... }: +{ + environment.systemPackages = with pkgs; [ eriixpkgs.packages.${system}.go-time ]; } diff --git a/modules/eriixpkgs/homepage-nix/default.nix b/modules/eriixpkgs/homepage-nix/default.nix index 38fc9b77..e853e979 100644 --- a/modules/eriixpkgs/homepage-nix/default.nix +++ b/modules/eriixpkgs/homepage-nix/default.nix @@ -1,4 +1,10 @@ -{ eriixpkgs, system, username, ... }: { +{ + eriixpkgs, + system, + username, + ... +}: +{ imports = [ eriixpkgs.nixosModules.${system}.homepage-nix ]; services.homepage-nix = { diff --git a/modules/eriixpkgs/russh/default.nix b/modules/eriixpkgs/russh/default.nix index 5ea71d3e..22a67635 100644 --- a/modules/eriixpkgs/russh/default.nix +++ b/modules/eriixpkgs/russh/default.nix @@ -1,3 +1,4 @@ -{ eriixpkgs, system, ... }: { +{ eriixpkgs, system, ... }: +{ environment.systemPackages = [ eriixpkgs.packages.${system}.russh ]; } diff --git a/modules/gnome/default.nix b/modules/gnome/default.nix index aa50f1ff..ff6ac27f 100644 --- a/modules/gnome/default.nix +++ b/modules/gnome/default.nix @@ -1,4 +1,9 @@ -{ pkgs, home-manager, username, ... }: +{ + pkgs, + home-manager, + username, + ... +}: let gnomeExtensionsList = with pkgs.gnomeExtensions; [ user-themes @@ -14,7 +19,8 @@ let tailscale-qs tailscale-status ]; -in { +in +{ # ---- Home Configuration ---- home-manager.users.${username} = { @@ -22,7 +28,8 @@ in { dconf.settings = { "org/gnome/shell".enabled-extensions = - (map (extension: extension.extensionUuid) gnomeExtensionsList) ++ [ + (map (extension: extension.extensionUuid) gnomeExtensionsList) + ++ [ "auto-move-windows@gnome-shell-extensions.gcampax.github.com" "window-list@gnome-shell-extensions.gcampax.github.com" "places-menu@gnome-shell-extensions.gcampax.github.com" @@ -64,12 +71,11 @@ in { ]; }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = - { - binding = "q"; - command = "foot > /dev/null 2>&1 &"; - name = "open-terminal"; - }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "q"; + command = "foot > /dev/null 2>&1 &"; + name = "open-terminal"; + }; "org/gnome/shell/keybindings" = { show-screenshot-ui = [ "s" ]; @@ -77,7 +83,11 @@ in { "org/gnome/desktop/wm/preferences" = { # Workspace Indicator panel - workspace-names = [ "Browser" "Code" "Virt" ]; + workspace-names = [ + "Browser" + "Code" + "Virt" + ]; button-layout = "appmenu:minimize,maximize,close"; }; @@ -105,7 +115,9 @@ in { unmaximize = "disabled"; }; - "org/gnome/shell/extensions/pop-shell" = { tile-by-default = true; }; + "org/gnome/shell/extensions/pop-shell" = { + tile-by-default = true; + }; # Configure blur-my-shell "org/gnome/shell/extensions/blur-my-shell" = { @@ -138,7 +150,9 @@ in { display-all-workspaces = true; }; - "org/gnome/shell/extensions/user-theme" = { name = "nordic"; }; + "org/gnome/shell/extensions/user-theme" = { + name = "nordic"; + }; }; }; @@ -161,7 +175,12 @@ in { environment.systemPackages = with pkgs; [ nordic ]; environment.gnome.excludePackages = - (with pkgs; [ gnome-photos gnome-tour gedit ]) ++ (with pkgs.gnome; [ + (with pkgs; [ + gnome-photos + gnome-tour + gedit + ]) + ++ (with pkgs.gnome; [ gnome-music epiphany geary diff --git a/modules/hardware/audio/default.nix b/modules/hardware/audio/default.nix index 0bd9b056..7a683dde 100644 --- a/modules/hardware/audio/default.nix +++ b/modules/hardware/audio/default.nix @@ -1,5 +1,8 @@ -{ pkgs, username, ... }: { - users.users.${username} = { extraGroups = [ "audio" ]; }; +{ pkgs, username, ... }: +{ + users.users.${username} = { + extraGroups = [ "audio" ]; + }; # Sound settings security.rtkit.enable = true; sound.enable = true; diff --git a/modules/hardware/bluetooth/default.nix b/modules/hardware/bluetooth/default.nix index 84147e94..23f3d4fe 100644 --- a/modules/hardware/bluetooth/default.nix +++ b/modules/hardware/bluetooth/default.nix @@ -3,4 +3,3 @@ hardware.bluetooth.enable = true; services.blueman.enable = true; } - diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index b10d5e05..f7b8c8c7 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1 +1,8 @@ -{ ... }: { imports = [ ./bluetooth ./network ./audio ]; } +{ ... }: +{ + imports = [ + ./bluetooth + ./network + ./audio + ]; +} diff --git a/modules/hardware/network/default.nix b/modules/hardware/network/default.nix index 5f1ab6e7..ab3877c6 100644 --- a/modules/hardware/network/default.nix +++ b/modules/hardware/network/default.nix @@ -1,4 +1,5 @@ -{ hostName, username, ... }: { +{ hostName, username, ... }: +{ networking = { networkmanager = { enable = true; @@ -6,5 +7,7 @@ }; inherit hostName; }; - users.users.${username} = { extraGroups = [ "networkmanager" ]; }; + users.users.${username} = { + extraGroups = [ "networkmanager" ]; + }; } diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix index 72049849..3533e4fc 100644 --- a/modules/hardware/nvidia/default.nix +++ b/modules/hardware/nvidia/default.nix @@ -1,4 +1,10 @@ -{ config, pkgs, username, ... }: { +{ + config, + pkgs, + username, + ... +}: +{ # Environment variables # ---- I often have these enabled elsewhere but you may still want these if you are having issues ---- # Force wayland when possible @@ -23,31 +29,36 @@ nvidiaSettings = true; # Video card specific - stable supports "newer" cards, "production" is 550 # https://nixos.wiki/wiki/Nvidia#Running_the_new_RTX_SUPER_on_nixos_stable - package = let - rcu_patch = pkgs.fetchpatch { - url = - "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; - hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; - }; - in config.boot.kernelPackages.nvidiaPackages.mkDriver { - version = "535.154.05"; - sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; - sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; - openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; - settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; - persistencedSha256 = - "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; + package = + let + rcu_patch = pkgs.fetchpatch { + url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; + hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; + }; + in + config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "535.154.05"; + sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; + sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; + openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; + settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; + persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; - #version = "550.40.07"; - #sha256_64bit = "sha256-KYk2xye37v7ZW7h+uNJM/u8fNf7KyGTZjiaU03dJpK0="; - #sha256_aarch64 = "sha256-AV7KgRXYaQGBFl7zuRcfnTGr8rS5n13nGUIe3mJTXb4="; - #openSha256 = "sha256-mRUTEWVsbjq+psVe+kAT6MjyZuLkG2yRDxCMvDJRL1I="; - #settingsSha256 = "sha256-c30AQa4g4a1EHmaEu1yc05oqY01y+IusbBuq+P6rMCs="; - #persistencedSha256 = "sha256-11tLSY8uUIl4X/roNnxf5yS2PQvHvoNjnd2CB67e870="; + #version = "550.40.07"; + #sha256_64bit = "sha256-KYk2xye37v7ZW7h+uNJM/u8fNf7KyGTZjiaU03dJpK0="; + #sha256_aarch64 = "sha256-AV7KgRXYaQGBFl7zuRcfnTGr8rS5n13nGUIe3mJTXb4="; + #openSha256 = "sha256-mRUTEWVsbjq+psVe+kAT6MjyZuLkG2yRDxCMvDJRL1I="; + #settingsSha256 = "sha256-c30AQa4g4a1EHmaEu1yc05oqY01y+IusbBuq+P6rMCs="; + #persistencedSha256 = "sha256-11tLSY8uUIl4X/roNnxf5yS2PQvHvoNjnd2CB67e870="; - patches = [ rcu_patch ]; - }; + patches = [ rcu_patch ]; + }; }; - users.users.${username} = { extraGroups = [ "video" "render" ]; }; + users.users.${username} = { + extraGroups = [ + "video" + "render" + ]; + }; } diff --git a/modules/hyprland/config/default.nix b/modules/hyprland/config/default.nix index 237616e5..71f9c227 100644 --- a/modules/hyprland/config/default.nix +++ b/modules/hyprland/config/default.nix @@ -1,7 +1,16 @@ -{ pkgs, hyprlandConfig, home-manager, username, ... }: +{ + pkgs, + hyprlandConfig, + home-manager, + username, + ... +}: let dotfiles = { "laptop" = [ (import ./laptop.nix { inherit home-manager username; }) ]; "desktop" = [ (import ./desktop.nix { inherit home-manager username; }) ]; }; -in { imports = dotfiles.${hyprlandConfig} or [ ]; } +in +{ + imports = dotfiles.${hyprlandConfig} or [ ]; +} diff --git a/modules/hyprland/config/desktop.nix b/modules/hyprland/config/desktop.nix index d954c0f8..157e198b 100644 --- a/modules/hyprland/config/desktop.nix +++ b/modules/hyprland/config/desktop.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { @@ -18,7 +19,7 @@ monitor=DP-1,preferred,0x0,1,transform,3 monitor=,preferred,auto,auto - exec-once = swww init & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + exec-once = swww-daemon & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # some default env vars. env=BROWSER,firefox @@ -235,7 +236,6 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow ''; - }; }; } diff --git a/modules/hyprland/config/laptop.nix b/modules/hyprland/config/laptop.nix index b5f1e68c..f5e86391 100644 --- a/modules/hyprland/config/laptop.nix +++ b/modules/hyprland/config/laptop.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { @@ -15,7 +16,7 @@ #monitor=edp-1,3840 x 2160,auto,auto monitor=,preferred,auto,auto - exec-once = swww init & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + exec-once = swww-daemon & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # some default env vars. env=BROWSER, firefox @@ -223,7 +224,6 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow ''; - }; }; } diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 58e19e75..a70a1c0e 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -1,4 +1,13 @@ -{ hyprland, hyprpicker, pkgs, username, home-manager, system, ... }: { +{ + hyprland, + hyprpicker, + pkgs, + username, + home-manager, + system, + ... +}: +{ imports = [ hyprland.nixosModules.default ./config @@ -38,7 +47,9 @@ programs.dconf.enable = true; - services.gnome = { gnome-keyring.enable = true; }; + services.gnome = { + gnome-keyring.enable = true; + }; security.pam.services.login.enableGnomeKeyring = true; @@ -46,7 +57,10 @@ enable = true; config = { common = { - default = [ "xdph" "gtk" ]; + default = [ + "xdph" + "gtk" + ]; "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; "org.freedesktop.portal.FileChooser" = [ "xdg-desktop-portal-gtk" ]; }; @@ -54,4 +68,3 @@ extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; }; } - diff --git a/modules/hyprland/greetd/default.nix b/modules/hyprland/greetd/default.nix index c05fee99..2e1c6dbe 100644 --- a/modules/hyprland/greetd/default.nix +++ b/modules/hyprland/greetd/default.nix @@ -1,11 +1,11 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ services.greetd = { enable = true; restart = false; settings = { default_session = { - command = - "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to Wonderland' --asterisks --cmd Hyprland"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to Wonderland' --asterisks --cmd Hyprland"; user = username; }; }; diff --git a/modules/hyprland/hyprlock/default.nix b/modules/hyprland/hyprlock/default.nix index 90560694..8199b058 100644 --- a/modules/hyprland/hyprlock/default.nix +++ b/modules/hyprland/hyprlock/default.nix @@ -1,4 +1,10 @@ -{ home-manager, hyprlock, pkgs, username, ... }: { +{ + home-manager, + hyprlock, + pkgs, + username, + ... +}: +{ imports = [ hyprlock.homeManagerModules.hyprlock ]; - } diff --git a/modules/hyprland/mako/default.nix b/modules/hyprland/mako/default.nix index d7a98139..7b890a6b 100644 --- a/modules/hyprland/mako/default.nix +++ b/modules/hyprland/mako/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ environment.systemPackages = with pkgs; [ mako ]; home-manager.users.${username} = { home.file = { diff --git a/modules/hyprland/swaylock/default.nix b/modules/hyprland/swaylock/default.nix index 3add723e..a53a39fd 100644 --- a/modules/hyprland/swaylock/default.nix +++ b/modules/hyprland/swaylock/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ environment.systemPackages = with pkgs; [ swaylock ]; # Unlock with Swaylock security = { diff --git a/modules/hyprland/waybar/default.nix b/modules/hyprland/waybar/default.nix index b0c6d9a2..1f765455 100644 --- a/modules/hyprland/waybar/default.nix +++ b/modules/hyprland/waybar/default.nix @@ -1,10 +1,17 @@ -{ pkgs, hyprlandConfig, home-manager, username, ... }: +{ + pkgs, + hyprlandConfig, + home-manager, + username, + ... +}: let dotfiles = { "laptop" = [ (import ./laptop.nix { inherit home-manager username; }) ]; "desktop" = [ (import ./desktop.nix { inherit home-manager username; }) ]; }; -in { +in +{ imports = dotfiles.${hyprlandConfig} or [ ]; environment.systemPackages = with pkgs; [ waybar ]; } diff --git a/modules/hyprland/waybar/desktop.nix b/modules/hyprland/waybar/desktop.nix index 322ee848..9158b732 100644 --- a/modules/hyprland/waybar/desktop.nix +++ b/modules/hyprland/waybar/desktop.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { ".config/waybar/config.jsonc".text = '' @@ -106,7 +107,7 @@ "tooltip-format-enumerate-connected": "{device_alias} {device_address}" }, "network": { - "interface": "wlp*", + "interface": "enp*", "format": "󰱓 {bandwidthTotalBytes}", "format-disconnected": "{icon} No Internet", "format-linked": "󰅛 {ifname} (No IP)", @@ -235,7 +236,6 @@ color: #00ba69; } ''; - }; }; } diff --git a/modules/hyprland/waybar/laptop.nix b/modules/hyprland/waybar/laptop.nix index 44eb31ce..de6afa2d 100644 --- a/modules/hyprland/waybar/laptop.nix +++ b/modules/hyprland/waybar/laptop.nix @@ -1,4 +1,5 @@ -{ home-manager, username, ... }: { +{ home-manager, username, ... }: +{ home-manager.users.${username} = _: { home.file = { ".config/waybar/config.jsonc".text = '' diff --git a/modules/hyprland/wofi/default.nix b/modules/hyprland/wofi/default.nix index e0bbe4f7..4cacf2aa 100644 --- a/modules/hyprland/wofi/default.nix +++ b/modules/hyprland/wofi/default.nix @@ -1,4 +1,10 @@ -{ pkgs, home-manager, username, ... }: { +{ + pkgs, + home-manager, + username, + ... +}: +{ environment.systemPackages = with pkgs; [ wofi ]; home-manager.users.${username} = { diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix index 44065ad4..1ef72535 100644 --- a/modules/ssh/default.nix +++ b/modules/ssh/default.nix @@ -1,4 +1,5 @@ -{ username, ... }: { +{ username, ... }: +{ users.users.${username} = { openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAETSTzRnvYIQsOwhdwcbVRyZVnP6/F3b+inurb9+RMu ${username}" diff --git a/modules/steam/default.nix b/modules/steam/default.nix index 653001c9..b55025d9 100644 --- a/modules/steam/default.nix +++ b/modules/steam/default.nix @@ -1,4 +1,5 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ # Required to run Windows applications ie World of Warcraft #users.users.${username} = { # packages = with pkgs; [ @@ -14,5 +15,7 @@ # This can optionally be installed via flatpack. # Proton Experimental is pretty sweet - programs = { steam.enable = true; }; + programs = { + steam.enable = true; + }; } diff --git a/modules/tailscale/default.nix b/modules/tailscale/default.nix index 909c5fad..e39ed1c2 100644 --- a/modules/tailscale/default.nix +++ b/modules/tailscale/default.nix @@ -1,6 +1,10 @@ -{ username, ... }: { +{ username, ... }: +{ services.tailscale = { enable = true; - extraUpFlags = [ "--shields-up" "--operator=${username}" ]; + extraUpFlags = [ + "--shields-up" + "--operator=${username}" + ]; }; } diff --git a/modules/virt/default.nix b/modules/virt/default.nix index d0f27739..89f8933c 100644 --- a/modules/virt/default.nix +++ b/modules/virt/default.nix @@ -1,7 +1,7 @@ { imports = [ - ./docker.nix + #./docker.nix ./libvirt.nix - #./podman.nix + ./podman.nix ]; } diff --git a/modules/virt/docker.nix b/modules/virt/docker.nix index 047e888e..911d4d54 100644 --- a/modules/virt/docker.nix +++ b/modules/virt/docker.nix @@ -1,8 +1,11 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ environment.systemPackages = with pkgs; [ docker-compose ]; # Docker can also be run rootless - virtualisation.docker = { enable = true; }; + virtualisation.docker = { + enable = true; + }; # User permissions users.users.${username}.extraGroups = [ "docker" ]; } diff --git a/modules/virt/libvirt.nix b/modules/virt/libvirt.nix index 7b124f9f..d48e8a40 100644 --- a/modules/virt/libvirt.nix +++ b/modules/virt/libvirt.nix @@ -1,4 +1,5 @@ -{ config, pkgs, home-manager, username, ... }: { +{ pkgs, username, ... }: +{ virtualisation = { libvirtd = { enable = true; @@ -19,9 +20,8 @@ spice-gtk spice-protocol virt-viewer - virtio-win - win-spice - + #virtio-win + #win-spice ]; programs.virt-manager.enable = true; diff --git a/modules/virt/podman.nix b/modules/virt/podman.nix index 815c21c6..2ac4cf45 100644 --- a/modules/virt/podman.nix +++ b/modules/virt/podman.nix @@ -1,9 +1,12 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ podman-compose podman-tui ]; +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + podman-compose + podman-tui + ]; virtualisation.podman = { enable = true; defaultNetwork.settings.dns_enabled = true; - }; } diff --git a/sh/btrfs-luks.nix b/sh/btrfs-luks.nix new file mode 100644 index 00000000..ee06d393 --- /dev/null +++ b/sh/btrfs-luks.nix @@ -0,0 +1,70 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/vda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "defaults" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + # disable settings.keyFile if you want to use interactive password entry + # passwordFile = "/tmp/secret.key"; # Interactive + # settings = { + # allowDiscards = true; + # keyFile = "/tmp/secret.key"; + #}; + #additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "/swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "8G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/sh/btrfs.nix b/sh/btrfs.nix new file mode 100644 index 00000000..8dc66ded --- /dev/null +++ b/sh/btrfs.nix @@ -0,0 +1,55 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/vda"; # Ensure this matches the intended device + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "550M"; # ESP partition size to 550M as per your script + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; # Allocating the rest of the disk to the root partition, excluding ESP + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" ]; + }; + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + # Swap subvolume setup + "/swap" = { + mountOptions = [ "subvol=/swap" ]; # Ensuring it's mounted as a separate subvolume + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/sh/btrfs.sh b/sh/btrfs.sh new file mode 100644 index 00000000..b9360fd5 --- /dev/null +++ b/sh/btrfs.sh @@ -0,0 +1,30 @@ +#!/run/current-system/sw/bin/bash + +echo "Enter the device name (e.g., /dev/vda or /dev/sda): " +read -r DEVICE + +BOOT_PARTITION="${DEVICE}1" +ROOT_PARTITION="${DEVICE}2" + +printf "label: gpt\n,550M,U\n,,L\n" | sfdisk "$DEVICE" + +mkfs.fat -F 32 "$BOOT_PARTITION" +mkfs.btrfs "$ROOT_PARTITION" + +mkdir -p /mnt +mount "$ROOT_PARTITION" /mnt +btrfs subvolume create /mnt/root +btrfs subvolume create /mnt/home +btrfs subvolume create /mnt/nix +umount /mnt + +mount -o compress=zstd,subvol=root "$ROOT_PARTITION" /mnt +mkdir /mnt/{home,nix} +mount -o compress=zstd,subvol=home "$ROOT_PARTITION" /mnt/home +mount -o compress=zstd,noatime,subvol=nix "$ROOT_PARTITION" /mnt/nix +mkdir /mnt/boot +mount "$BOOT_PARTITION" /mnt/boot + +nixos-generate-config --root /mnt + +nix-shell -p neovim diff --git a/sh/clean.nix b/sh/clean.nix index ec75bf7d..ecf1a897 100644 --- a/sh/clean.nix +++ b/sh/clean.nix @@ -1,4 +1,6 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { }, +}: pkgs.stdenv.mkDerivation { name = "clean"; @@ -14,4 +16,3 @@ pkgs.stdenv.mkDerivation { chmod +x $out/bin/clean ''; } - diff --git a/users/default.nix b/users/default.nix index 02094ca8..02e37874 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1 +1,4 @@ -{ username, ... }: { imports = [ ./${username} ]; } +{ username, ... }: +{ + imports = [ ./${username} ]; +} diff --git a/users/eriim/default.nix b/users/eriim/default.nix index 4d915fa1..375f20af 100644 --- a/users/eriim/default.nix +++ b/users/eriim/default.nix @@ -1,9 +1,15 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.${username} = { shell = pkgs.bash; isNormalUser = true; initialPassword = "temp123"; - extraGroups = [ "wheel" "input" "video" "render" ]; + extraGroups = [ + "wheel" + "input" + "video" + "render" + ]; }; } diff --git a/users/nixos/default.nix b/users/nixos/default.nix index 6fb54b56..db9f9a9d 100644 --- a/users/nixos/default.nix +++ b/users/nixos/default.nix @@ -1,9 +1,10 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.${username} = { shell = pkgs.bash; isNormalUser = true; - initialPassword = "temp123"; + #initialPassword = "temp123"; extraGroups = [ "wheel" ]; }; } diff --git a/wsl.nix b/wsl.nix index 0a34cbff..6e6802fe 100644 --- a/wsl.nix +++ b/wsl.nix @@ -1,4 +1,5 @@ -{ home-manager, nixpkgs, ... }: { +{ home-manager, nixpkgs, ... }: +{ imports = [ home-manager.nixosModules.home-manager { nix.registry.nixpkgs.flake = nixpkgs; } @@ -6,5 +7,4 @@ ./modules/core/terminal ./modules/core/nix ]; - } From cd2494d855cc215764b8c16dc06759e72c3b2b88 Mon Sep 17 00:00:00 2001 From: Eric Tossell Date: Mon, 8 Apr 2024 21:44:33 -0400 Subject: [PATCH 2/2] nixos temp passwd --- users/nixos/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/nixos/default.nix b/users/nixos/default.nix index db9f9a9d..bec03734 100644 --- a/users/nixos/default.nix +++ b/users/nixos/default.nix @@ -4,7 +4,7 @@ users.users.${username} = { shell = pkgs.bash; isNormalUser = true; - #initialPassword = "temp123"; + initialPassword = "temp123"; extraGroups = [ "wheel" ]; }; }