fix: create container directories if not existent
This commit is contained in:
parent
8f55b769fe
commit
ad2efa8c9f
|
@ -7,6 +7,9 @@
|
|||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mapAttrs'
|
||||
concatStrings
|
||||
nameValuePair
|
||||
mapAttrsToList
|
||||
flip
|
||||
types
|
||||
|
@ -47,6 +50,15 @@ in {
|
|||
}
|
||||
));
|
||||
};
|
||||
config.system.activationScripts = let
|
||||
mkDir = paths: (concatStrings (flip map paths (path: ''
|
||||
[[ -d "${path}" ]] || ${pkgs.coreutils}/bin/mkdir -p "${path}"
|
||||
'')));
|
||||
in
|
||||
flip mapAttrs' config.containers (
|
||||
name: value:
|
||||
nameValuePair "mkContainerFolder-${name}" (mkDir (mapAttrsToList (_: x: x.hostPath) value.bindMounts))
|
||||
);
|
||||
config.disko = mkMerge (flip mapAttrsToList config.containers
|
||||
(
|
||||
_: cfg: {
|
||||
|
|
Loading…
Reference in a new issue