Auto-configure deploy nodes for all hosts

This commit is contained in:
SebastianStork 2025-05-10 23:41:54 +02:00
parent 6b02a9c967
commit dc05d383a3

View file

@ -30,6 +30,16 @@ let
]; ];
}; };
}; };
mkDeployNode = hostName: {
${hostName} = {
hostname = hostName;
sshUser = "root";
profiles.system.path =
inputs.deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.${hostName};
};
};
in in
{ {
flake = { flake = {
@ -39,12 +49,10 @@ in
|> lib.filterAttrs (_: type: type == "directory") |> lib.filterAttrs (_: type: type == "directory")
|> lib.concatMapAttrs (name: _: mkHost name); |> lib.concatMapAttrs (name: _: mkHost name);
deploy.nodes = { deploy.nodes =
alto = { "${self}/hosts"
hostname = "alto"; |> builtins.readDir
sshUser = "root"; |> lib.filterAttrs (_: type: type == "directory")
profiles.system.path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.alto; |> lib.concatMapAttrs (name: _: mkDeployNode name);
};
};
}; };
} }