Evergrowing NixOS flake of my setup.
1

Configure Feed

Select the types of activity you want to include in your feed.

pass down hostnames to each host and home-manager

MasterEnderman (Jul 12, 2026, 3:23 PM +0200) 2a180bf0 e9066e2a

+33 -26
+33 -26
flake.nix
··· 79 79 customPkgs = import ./modules/nixos/pkgs {inherit pkgs;}; 80 80 81 81 # ═══════════════════════════════════════════════════════════ 82 + # Single source of truth for every machine in this flake. 83 + # ═══════════════════════════════════════════════════════════ 84 + hosts = ["hp-probook"]; 85 + 86 + # ═══════════════════════════════════════════════════════════ 82 87 # HELPER: mkHost 83 88 # Creates a complete NixOS configuration from just a hostname. 84 89 # Automatically includes base features, HM setup, and host-specific modules. 85 - # Usage: my-machine = mkHost "my-machine"; 86 90 # ═══════════════════════════════════════════════════════════ 87 91 mkHost = hostname: 88 92 nixpkgs.lib.nixosSystem { ··· 90 94 91 95 specialArgs = { 92 96 inherit inputs hostname customPkgs; 97 + allHosts = hosts; 93 98 }; 94 99 95 100 modules = [ ··· 122 127 config, 123 128 pkgs, 124 129 inputs, 130 + hostname, 131 + allHosts, 125 132 ... 126 133 }: { 127 - home-manager.useGlobalPkgs = true; 128 - home-manager.useUserPackages = true; 134 + home-manager = { 135 + useGlobalPkgs = true; 136 + useUserPackages = true; 137 + extraSpecialArgs = { 138 + inherit inputs hostname allHosts customPkgs; 139 + }; 129 140 130 - home-manager.users.enderman = { 131 - pkgs, 132 - lib, 133 - ... 134 - }: { 135 - imports = [ 136 - inputs.noctalia.homeModules.default 137 - inputs.sops-nix.homeManagerModules.sops 138 - ./modules/home/enderman 139 - ]; 140 - 141 - home.username = "enderman"; 142 - home.homeDirectory = "/home/enderman"; 143 - home.stateVersion = "26.05"; 144 - programs.home-manager.enable = true; 141 + users.enderman = { 142 + pkgs, 143 + lib, 144 + ... 145 + }: { 146 + imports = [ 147 + inputs.noctalia.homeModules.default 148 + inputs.sops-nix.homeManagerModules.sops 149 + ./modules/home/enderman 150 + ]; 151 + home = { 152 + username = "enderman"; 153 + homeDirectory = "/home/enderman"; 154 + stateVersion = "26.05"; 155 + }; 156 + programs.home-manager.enable = true; 157 + }; 145 158 }; 146 159 }) 147 160 ]; ··· 149 162 in { 150 163 # ═══════════════════════════════════════════════════════════ 151 164 # NIXOS CONFIGURATIONS 152 - # Add new machines by simply adding a line here! 165 + # Add new machines by adding a hostname to `hosts` above. 153 166 # ═══════════════════════════════════════════════════════════ 154 - nixosConfigurations = { 155 - hp-probook = mkHost "hp-probook"; 156 - 157 - # Example: Add more machines easily 158 - # gaming-pc = mkHost "gaming-pc"; 159 - # server-01 = mkHost "server-01"; 160 - }; 167 + nixosConfigurations = nixpkgs.lib.genAttrs hosts mkHost; 161 168 }; 162 169 }