summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parts/deploy.nix10
-rw-r--r--parts/lib/utils.nix23
2 files changed, 16 insertions, 17 deletions
diff --git a/parts/deploy.nix b/parts/deploy.nix
index cce2b00..dbb1cc3 100644
--- a/parts/deploy.nix
+++ b/parts/deploy.nix
@@ -1,9 +1,15 @@
-{self, ...}: let
+{
+ self,
+ lib,
+ ...
+}: let
targets = ["atlas" "p-body"];
+
+ targets' = lib.filterAttrs (n: _: builtins.elem n targets) self.nixosConfigurations;
in {
flake.deploy = {
remoteBuild = true;
fastConnection = true;
- nodes = self.lib.utils.mkDeployNodes targets;
+ nodes = self.lib.utils.mkDeployNodes targets';
};
}
diff --git a/parts/lib/utils.nix b/parts/lib/utils.nix
index e88d651..4473e22 100644
--- a/parts/lib/utils.nix
+++ b/parts/lib/utils.nix
@@ -1,8 +1,4 @@
-{
- self,
- inputs,
- ...
-}: let
+{inputs, ...}: let
deployPkgs = pkgs:
import pkgs.path {
inherit (pkgs) system;
@@ -17,14 +13,11 @@
];
};
in {
- mkDeployNodes = hosts:
- inputs.nixpkgs.lib.genAttrs hosts (host: let
- system = self.nixosConfigurations.${host};
- inherit (system) pkgs;
- inherit (deployPkgs pkgs) deploy-rs;
- in {
- sshUser = "root";
- hostname = system.config.networking.hostName;
- profiles.system.path = deploy-rs.lib.activate.nixos system;
- });
+ mkDeployNodes = builtins.mapAttrs (_: system: let
+ inherit (deployPkgs system.pkgs) deploy-rs;
+ in {
+ sshUser = "root";
+ hostname = system.config.networking.hostName;
+ profiles.system.path = deploy-rs.lib.activate.nixos system;
+ });
}