cluster/lib: implement injectNixosConfigForServices to select individual services
This commit is contained in:
parent
faf51fa151
commit
6aa6cd2f6b
2 changed files with 10 additions and 6 deletions
|
@ -2,9 +2,9 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
options.out.injectNixosConfig = mkOption {
|
options.out = mkOption {
|
||||||
description = "NixOS configuration to inject into the given host.";
|
description = "Output functions.";
|
||||||
type = with types; functionTo raw;
|
type = with types; lazyAttrsOf (functionTo raw);
|
||||||
default = const [];
|
default = const [];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,11 @@ in
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.out.injectNixosConfig = hostName: (lib.flatten (lib.mapAttrsToList (getHostConfigurations hostName) config.services)) ++ [
|
config.out = {
|
||||||
|
injectNixosConfigForServices = services: hostName: (lib.flatten (lib.mapAttrsToList (getHostConfigurations hostName) (lib.getAttrs services config.services))) ++ [
|
||||||
introspectionModule
|
introspectionModule
|
||||||
];
|
];
|
||||||
|
|
||||||
|
injectNixosConfig = config.out.injectNixosConfigForServices (lib.attrNames config.services);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue