My NixOS configuration (mirror)

feat: tidied up flake confug

+31 -51
+31 -51
flake.nix
··· 36 36 home-manager, 37 37 nixpkgs, 38 38 ... 39 - }: { 40 - nixosConfigurations = { 41 - toad = nixpkgs.lib.nixosSystem { 42 - system = "x86_64-linux"; 39 + }: let 40 + system = "x86_64-linux"; 43 41 44 - specialArgs = { 45 - inherit inputs; 46 - hostname = "toad"; 47 - }; 42 + mkHost = hostname: modules: 43 + nixpkgs.lib.nixosSystem { 44 + inherit system; 48 45 49 - modules = [ 50 - ./hosts/toad/configuration.nix 51 - home-manager.nixosModules.home-manager 52 - { 53 - environment.systemPackages = [ 54 - ghostty.packages.x86_64-linux.default 55 - ]; 56 - nixpkgs.overlays = [ 57 - inputs.niri.overlays.niri 58 - ]; 59 - home-manager.useGlobalPkgs = true; 60 - home-manager.useUserPackages = true; 61 - home-manager.extraSpecialArgs = { 62 - inherit inputs; 63 - hostname = "toad"; 64 - }; 65 - home-manager.users.matthew_hre = import ./home/default.nix; 66 - } 67 - ]; 68 - }; 69 - thwomp = nixpkgs.lib.nixosSystem { 70 - system = "x86_64-linux"; 46 + specialArgs = {inherit inputs hostname;}; 71 47 72 - specialArgs = { 73 - inherit inputs; 74 - hostname = "thwomp"; 75 - }; 48 + modules = 49 + modules 50 + ++ [ 51 + home-manager.nixosModules.home-manager 52 + { 53 + environment.systemPackages = [ 54 + ghostty.packages.${system}.default 55 + ]; 76 56 77 - modules = [ 78 - ./hosts/thwomp/configuration.nix 79 - home-manager.nixosModules.home-manager 80 - { 81 - environment.systemPackages = [ 82 - ghostty.packages.x86_64-linux.default 83 - ]; 84 - home-manager.useGlobalPkgs = true; 85 - home-manager.useUserPackages = true; 86 - home-manager.extraSpecialArgs = { 87 - inherit inputs; 88 - hostname = "thwomp"; 89 - }; 90 - home-manager.users.matthew_hre = import ./home/default.nix; 91 - } 92 - ]; 57 + home-manager = { 58 + useGlobalPkgs = true; 59 + useUserPackages = true; 60 + extraSpecialArgs = {inherit inputs hostname;}; 61 + users.matthew_hre = import ./home/default.nix; 62 + }; 63 + } 64 + ]; 93 65 }; 66 + in { 67 + nixosConfigurations = { 68 + toad = mkHost "toad" [ 69 + ./hosts/toad/configuration.nix 70 + {nixpkgs.overlays = [inputs.niri.overlays.niri];} 71 + ]; 72 + thwomp = mkHost "thwomp" [./hosts/thwomp/configuration.nix]; 94 73 }; 95 - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; 74 + 75 + formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; 96 76 }; 97 77 }