From faa11c9d45949922555bf82dda77804828193fa3 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 13 Dec 2023 15:39:09 -0500 Subject: systems: nixinate -> deploy-rs (again (again)) nixinate just hangs as of 163daad93da692fc280036b80f29ca9b65c005d4 --- systems/deploy.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 systems/deploy.nix (limited to 'systems/deploy.nix') diff --git a/systems/deploy.nix b/systems/deploy.nix new file mode 100644 index 0000000..186ff37 --- /dev/null +++ b/systems/deploy.nix @@ -0,0 +1,43 @@ +{ + lib, + inputs, + self, + ... +}: let + targets = ["atlas"]; + + getDeploy = pkgs: + (import pkgs.path { + inherit (pkgs) system; + overlays = [ + inputs.deploy.overlay + (_: prev: { + deploy-rs = { + inherit (pkgs) deploy-rs; + inherit (prev.deploy-rs) lib; + }; + }) + ]; + }) + .deploy-rs; + + getType = pkgs: + if pkgs.stdenv.isDarwin + then "darwin" + else "nixos"; + + toDeployNode = hostname: system: { + sshUser = "root"; + inherit hostname; + profiles.system.path = (getDeploy system.pkgs).lib.activate.${getType system.pkgs} system; + }; +in { + flake.deploy = { + remoteBuild = true; + fastConnection = false; + nodes = lib.pipe (self.nixosConfigurations // self.darwinConfigurations) [ + (lib.getAttrs targets) + (lib.mapAttrs toDeployNode) + ]; + }; +} -- cgit v1.2.3