mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 00:21:34 +01:00
hosts.nix: replace lib.concatMapAttrs with lib.mapAttrs
This commit is contained in:
parent
5e18975b9b
commit
043a996319
1 changed files with 12 additions and 14 deletions
|
|
@ -5,8 +5,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
mkHost = hostName: {
|
mkHost =
|
||||||
${hostName} = inputs.nixpkgs.lib.nixosSystem {
|
hostName:
|
||||||
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs self; };
|
specialArgs = { inherit inputs self; };
|
||||||
modules =
|
modules =
|
||||||
let
|
let
|
||||||
|
|
@ -21,17 +22,14 @@ let
|
||||||
]
|
]
|
||||||
++ hostFiles;
|
++ hostFiles;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
mkDeployNode = hostName: {
|
mkDeployNode = hostname: {
|
||||||
${hostName} = {
|
inherit hostname;
|
||||||
hostname = hostName;
|
user = "root";
|
||||||
user = "root";
|
interactiveSudo = true;
|
||||||
interactiveSudo = true;
|
profiles.system.path =
|
||||||
profiles.system.path =
|
inputs.deploy-rs.lib.x86_64-linux.activate.nixos
|
||||||
inputs.deploy-rs.lib.x86_64-linux.activate.nixos
|
self.nixosConfigurations.${hostname};
|
||||||
self.nixosConfigurations.${hostName};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -40,13 +38,13 @@ in
|
||||||
"${self}/hosts"
|
"${self}/hosts"
|
||||||
|> builtins.readDir
|
|> builtins.readDir
|
||||||
|> lib.filterAttrs (_: type: type == "directory")
|
|> lib.filterAttrs (_: type: type == "directory")
|
||||||
|> lib.concatMapAttrs (name: _: mkHost name);
|
|> lib.mapAttrs (name: _: mkHost name);
|
||||||
|
|
||||||
deploy.nodes =
|
deploy.nodes =
|
||||||
"${self}/hosts"
|
"${self}/hosts"
|
||||||
|> builtins.readDir
|
|> builtins.readDir
|
||||||
|> lib.filterAttrs (_: type: type == "directory")
|
|> lib.filterAttrs (_: type: type == "directory")
|
||||||
|> lib.concatMapAttrs (name: _: mkDeployNode name);
|
|> lib.mapAttrs (name: _: mkDeployNode name);
|
||||||
|
|
||||||
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue