diff options
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix index 9d87f10..f3342cd 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,11 @@ impermanence.url = "github:nix-community/impermanence"; + deploy-rs = { + url = "github:serokell/deploy-rs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/NUR"; nix-index.url = "github:Mic92/nix-index-database"; @@ -81,5 +86,25 @@ isIso = false; isHardware = false; }); + + + deploy = { + magicRollback = true; + autoRollback = true; + + nodes = builtins.mapAttrs + (_: nixosConfig: { + hostname = "${nixosConfig.config.networking.hostName}"; + + profiles.system = { + user = "root"; + path = inputs.deploy-rs.lib.${nixosConfig.config.nixpkgs.system}.activate.nixos nixosConfig; + }; + }) + self.nixosConfigurations; + }; + + # This is highly advised, and will prevent many possible mistakes + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; }; } |