From 550b9057a215eb46943fcae51b27632639ae46d5 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 29 Dec 2023 07:03:10 -0500 Subject: Revert "systems: nixinate works again" This reverts commit 874a58f74dea0ee6aa775f43f688e8397bc8cfb5. --- systems/deploy.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 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..fbf20d3 --- /dev/null +++ b/systems/deploy.nix @@ -0,0 +1,44 @@ +{ + lib, + inputs, + self, + ... +}: let + targets = ["atlas"]; + configurations = self.nixosConfigurations // self.darwinConfigurations; + + getDeploy = pkgs: + (pkgs.appendOverlays [ + inputs.deploy.overlay + (_: prev: { + deploy-rs = { + inherit (pkgs) deploy-rs; + inherit (prev.deploy-rs) lib; + }; + }) + ]) + .deploy-rs; + + toType = system: + { + "Linux" = "nixos"; + "Darwin" = "darwin"; + } + .${system}; + + toDeployNode = hostname: system: { + sshUser = "root"; + inherit hostname; + profiles.system.path = let + deploy = getDeploy system.pkgs; + type = toType system.pkgs.stdenv.hostPlatform.uname.system; + in + deploy.lib.activate.${type} system; + }; +in { + flake.deploy = { + remoteBuild = true; + fastConnection = false; + nodes = lib.mapAttrs toDeployNode (lib.getAttrs targets configurations); + }; +} -- cgit v1.2.3