inventory: allow per role configuration

This commit is contained in:
Jörg Thalheim
2024-07-15 13:43:43 +02:00
parent f6d30b4154
commit 8e7a34af0d
2 changed files with 7 additions and 0 deletions

View File

@@ -83,6 +83,11 @@ let
else
throw "Module doesn't have role: '${role}'. Path: ${path} not found."
) inverseRoles.${machineName} or [ ];
roleServiceConfigs = builtins.map (
role:
serviceConfig.roles.${role}.config or { }
) inverseRoles.${machineName} or [ ];
in
if isInService then
acc2
@@ -92,6 +97,7 @@ let
config.clan.${moduleName} = lib.mkMerge [
globalConfig
machineServiceConfig
roleServiceConfigs
];
}
{

View File

@@ -94,6 +94,7 @@ in
apply = lib.unique;
type = t.listOf tagRef;
};
options.config = moduleConfig;
}
);
};