mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21: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
|
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);
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue