WIP
This commit is contained in:
@@ -9,10 +9,12 @@ let
|
||||
containers = lib.mapAttrs' (cName: cValue:
|
||||
lib.nameValuePair "${name}-${cName}" cValue
|
||||
) defs.containers;
|
||||
paths = defs.paths or [];
|
||||
}
|
||||
) enabledConfigs;
|
||||
mergedContainers = lib.attrsets.mergeAttrsList (lib.map(e: e.containers) containerSetsList);
|
||||
allPathConfigs = lib.flatten (lib.map (e: e.paths or []) containerSetsList);
|
||||
allPathConfigs = lib.flatten (lib.map (e: e.paths) containerSetsList);
|
||||
allScriptConfigs = lib.flatten (lib.map (e: e.init or "") containerSetsList);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf ( enabledConfigs != {} ) {
|
||||
@@ -35,9 +37,9 @@ in
|
||||
system.activationScripts.container-setup-dirs = {
|
||||
deps = [ "users" "groups" ];
|
||||
text = lib.concatStringsSep "\n" (map (cfg: ''
|
||||
mkdir -p "${cfg.path}"
|
||||
chown ${cfg.owner} "${cfg.path}"
|
||||
chmod ${cfg.mode} "${cfg.path}"
|
||||
${pkgs.coreutils}/bin/mkdir -p "${cfg.path}"
|
||||
${pkgs.coreutils}/bin/chown ${cfg.owner} "${cfg.path}"
|
||||
${pkgs.coreutils}/bin/chmod ${cfg.mode} "${cfg.path}"
|
||||
'') allPathConfigs);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user