diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -22,9 +22,16 @@ | |||
22 | ref = "master"; | 22 | ref = "master"; |
23 | inputs.nixpkgs.follows = "nixpkgs"; | 23 | inputs.nixpkgs.follows = "nixpkgs"; |
24 | }; | 24 | }; |
25 | deploy-rs = { | ||
26 | type = "github"; | ||
27 | owner = "serokell"; | ||
28 | repo = "deploy-rs"; | ||
29 | ref = "master"; | ||
30 | inputs.nixpkgs.follows = "nixpkgs"; | ||
31 | }; | ||
25 | }; | 32 | }; |
26 | 33 | ||
27 | outputs = { self, nixpkgs, home-manager, sops-nix, ... }@inputs: | 34 | outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, ... }@inputs: |
28 | let | 35 | let |
29 | inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; | 36 | inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; |
30 | inherit (nixpkgs) lib; | 37 | inherit (nixpkgs) lib; |
@@ -157,11 +164,22 @@ | |||
157 | 164 | ||
158 | apps = activateNixosConfigurations; | 165 | apps = activateNixosConfigurations; |
159 | 166 | ||
160 | devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; }); | 167 | devShell = forAllSystems (system: systemPkgs: import ./shell.nix { pkgs = self.legacyPackages.${system}; deploy-rs = deploy-rs.defaultPackage.${system}; }); |
161 | 168 | ||
162 | defaultTemplate = { | 169 | defaultTemplate = { |
163 | path = ./.; | 170 | path = ./.; |
164 | description = "GKleen's flakey nixos configuration"; | 171 | description = "GKleen's flakey nixos configuration"; |
165 | }; | 172 | }; |
173 | |||
174 | deploy.nodes = mapAttrs (hostname: _: { | ||
175 | inherit hostname; | ||
176 | sshUser = "root"; | ||
177 | |||
178 | profiles.system = { | ||
179 | path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.nixos self.nixosConfigurations.${hostname}; | ||
180 | }; | ||
181 | }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); | ||
182 | |||
183 | checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; | ||
166 | }; | 184 | }; |
167 | } | 185 | } |