Inventory: fix roles config
This commit is contained in:
@@ -19,7 +19,10 @@
|
|||||||
},
|
},
|
||||||
"roles": {
|
"roles": {
|
||||||
"default": {
|
"default": {
|
||||||
"machines": ["minimal-inventory-machine"]
|
"machines": ["minimal-inventory-machine"],
|
||||||
|
"config": {
|
||||||
|
"packages": ["vim"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"machines": {
|
"machines": {
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ let
|
|||||||
) inverseRoles.${machineName} or [ ];
|
) inverseRoles.${machineName} or [ ];
|
||||||
|
|
||||||
roleServiceConfigs = builtins.map (
|
roleServiceConfigs = builtins.map (
|
||||||
role:
|
role: serviceConfig.roles.${role}.config or { }
|
||||||
serviceConfig.roles.${role}.config or { }
|
|
||||||
) inverseRoles.${machineName} or [ ];
|
) inverseRoles.${machineName} or [ ];
|
||||||
in
|
in
|
||||||
if isInService then
|
if isInService then
|
||||||
@@ -94,11 +93,13 @@ let
|
|||||||
++ [
|
++ [
|
||||||
{
|
{
|
||||||
imports = [ clan-core.clanModules.${moduleName} ] ++ roleModules;
|
imports = [ clan-core.clanModules.${moduleName} ] ++ roleModules;
|
||||||
config.clan.${moduleName} = lib.mkMerge [
|
config.clan.${moduleName} = lib.mkMerge (
|
||||||
|
[
|
||||||
globalConfig
|
globalConfig
|
||||||
machineServiceConfig
|
machineServiceConfig
|
||||||
roleServiceConfigs
|
]
|
||||||
];
|
++ roleServiceConfigs
|
||||||
|
);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
config.clan.inventory.services.${moduleName}.${instanceName} = {
|
config.clan.inventory.services.${moduleName}.${instanceName} = {
|
||||||
|
|||||||
Reference in New Issue
Block a user