mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
feat(submodules): support for submodule passthru
This commit is contained in:
parent
7afbc91301
commit
a8dcc69d54
5 changed files with 30 additions and 30 deletions
|
|
@ -44,6 +44,20 @@ let
|
|||
then throw "No module found ${name}/${if version == null then "latest" else version}"
|
||||
else head versionSortedSubmodules;
|
||||
in matchingModule;
|
||||
|
||||
passthruConfig = mapAttrsToList (name: opt: {
|
||||
${name} = mkMerge (mapAttrsToList (_: inst:
|
||||
if inst.passthru.enable
|
||||
then inst.config.submodule.passthru.${name} or {}
|
||||
else {}
|
||||
) config.submodules.instances);
|
||||
|
||||
_module.args = mkMerge (mapAttrsToList (_: inst:
|
||||
if inst.passthru.enable
|
||||
then inst.config.submodule.passthru._module.args or {}
|
||||
else {}
|
||||
) config.submodules.instances);
|
||||
}) (removeAttrs options ["_definedNames" "_module" "submodules"]);
|
||||
in {
|
||||
imports = [ ./base.nix ];
|
||||
|
||||
|
|
@ -248,5 +262,5 @@ in {
|
|||
};
|
||||
}];
|
||||
})
|
||||
];
|
||||
] ++ passthruConfig);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue