mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Auto-configure deploy nodes for all hosts
This commit is contained in:
parent
6b02a9c967
commit
dc05d383a3
1 changed files with 15 additions and 7 deletions
|
|
@ -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
|
||||
{
|
||||
flake = {
|
||||
|
|
@ -39,12 +49,10 @@ in
|
|||
|> lib.filterAttrs (_: type: type == "directory")
|
||||
|> lib.concatMapAttrs (name: _: mkHost name);
|
||||
|
||||
deploy.nodes = {
|
||||
alto = {
|
||||
hostname = "alto";
|
||||
sshUser = "root";
|
||||
profiles.system.path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.alto;
|
||||
};
|
||||
};
|
||||
deploy.nodes =
|
||||
"${self}/hosts"
|
||||
|> builtins.readDir
|
||||
|> lib.filterAttrs (_: type: type == "directory")
|
||||
|> lib.concatMapAttrs (name: _: mkDeployNode name);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue