diff options
| -rw-r--r-- | flake.nix | 32 |
1 files changed, 18 insertions, 14 deletions
| @@ -174,20 +174,24 @@ | |||
| 174 | description = "GKleen's flakey nixos configuration"; | 174 | description = "GKleen's flakey nixos configuration"; |
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| 177 | deploy.nodes = mapAttrs (hostname: _: { | 177 | deploy.nodes = let |
| 178 | inherit hostname; | 178 | defaults = mapAttrs (hostname: _: { |
| 179 | sshUser = "root"; | 179 | inherit hostname; |
| 180 | 180 | sshUser = "root"; | |
| 181 | profilesOrder = ["system"]; # system first | 181 | |
| 182 | profiles = { | 182 | profilesOrder = ["system"]; # system first |
| 183 | system = { | 183 | profiles = { |
| 184 | path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.nixos self.nixosConfigurations.${hostname}; | 184 | system = { |
| 185 | }; | 185 | path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.nixos self.nixosConfigurations.${hostname}; |
| 186 | } // (mapAttrs (_user: usercfg: { | 186 | }; |
| 187 | user = usercfg.home.username; | 187 | } // (mapAttrs (_user: usercfg: { |
| 188 | path = activateHomeManager (self.nixosConfigurations.${hostname}.config.nixpkgs.system) usercfg.home; | 188 | user = usercfg.home.username; |
| 189 | }) self.nixosConfigurations.${hostname}.config.home-manager.users); | 189 | path = activateHomeManager (self.nixosConfigurations.${hostname}.config.nixpkgs.system) usercfg.home; |
| 190 | }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); | 190 | }) self.nixosConfigurations.${hostname}.config.home-manager.users); |
| 191 | }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); | ||
| 192 | overrides = if pathExists ./deploy then nixImport { dir = ./deploy; _import = path: _name: import (./deploy + "/${path}") inputs; } else {}; | ||
| 193 | filterEnabled = attrs: mapAttrs (_n: v: filterAttrs (n: _v: n != "enabled") v) (filterAttrs (_n: v: v.enabled or true) attrs); | ||
| 194 | in mapAttrs (_n: v: if v ? "profiles" then v // { profiles = filterEnabled v.profiles; } else v) (filterEnabled (recursiveUpdate defaults overrides)); | ||
| 191 | 195 | ||
| 192 | checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; | 196 | checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; |
| 193 | }; | 197 | }; |
