diff options
| author | seth <[email protected]> | 2023-12-13 15:39:09 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-13 15:42:21 -0500 |
| commit | faa11c9d45949922555bf82dda77804828193fa3 (patch) | |
| tree | 4e21f4d6800e3c2a451a047cdd4365d937cef32c /systems | |
| parent | 109114703b42ba17c8f2a4a347bd4a9ecd1e82d5 (diff) | |
systems: nixinate -> deploy-rs (again (again))
nixinate just hangs as of 163daad93da692fc280036b80f29ca9b65c005d4
Diffstat (limited to 'systems')
| -rw-r--r-- | systems/atlas/default.nix | 8 | ||||
| -rw-r--r-- | systems/default.nix | 6 | ||||
| -rw-r--r-- | systems/deploy.nix | 43 |
3 files changed, 45 insertions, 12 deletions
diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix index bce1a04..2a8346f 100644 --- a/systems/atlas/default.nix +++ b/systems/atlas/default.nix @@ -10,14 +10,6 @@ ./nginx.nix ]; - _module.args.nixinate = { - host = "atlas"; - sshUser = "root"; - buildOn = "remote"; - substituteOnTarget = true; - hermetic = false; - }; - age.secrets.teawiebot.file = secretsDir + "/teawieBot.age"; boot = { diff --git a/systems/default.nix b/systems/default.nix index c442d90..de2f9e1 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -28,6 +28,8 @@ mapNixOS = mapSystems inputs.nixpkgs.lib.nixosSystem; inherit (import ./common.nix {inherit inputs self;}) darwin nixos server; in { + imports = [./deploy.nix]; + flake = { darwinConfigurations = mapDarwin { caroline = { @@ -76,8 +78,4 @@ in { inherit (inputs) openwrt-imagebuilder; }); }; - - perSystem = {system, ...}: { - apps = (inputs.nixinate.nixinate.${system} self).nixinate; - }; } 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) + ]; + }; +} |
