summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-12-12 14:11:05 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-12-12 14:11:05 +0100
commitba31496ec11ec48cc2c4f564fe054984ce614657 (patch)
tree39dc4a9444c705c44c665ffd0fafa540f40260fb /flake.nix
parentab9c3e24f1f33e1b52065f295521d4184fb7f61b (diff)
downloadnixos-ba31496ec11ec48cc2c4f564fe054984ce614657.tar
nixos-ba31496ec11ec48cc2c4f564fe054984ce614657.tar.gz
nixos-ba31496ec11ec48cc2c4f564fe054984ce614657.tar.bz2
nixos-ba31496ec11ec48cc2c4f564fe054984ce614657.tar.xz
nixos-ba31496ec11ec48cc2c4f564fe054984ce614657.zip
deploy-rs, zfs: ...
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix22
1 files changed, 20 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index bb3c45c5..768f19bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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}