krebs.permown: mkdirs on activation

This commit is contained in:
tv 2019-04-18 01:23:55 +02:00
parent 520c9ef692
commit bc200e5155

View File

@ -37,6 +37,12 @@ with import <stockholm/lib>;
plans = attrValues config.krebs.permown; plans = attrValues config.krebs.permown;
in mkIf (plans != []) { in mkIf (plans != []) {
system.activationScripts.permown = let
mkdir = plan: /* sh */ ''
${pkgs.coreutils}/bin/mkdir -p ${shell.escape plan.path}
'';
in concatMapStrings mkdir plans;
systemd.services = genAttrs' plans (plan: { systemd.services = genAttrs' plans (plan: {
name = "permown.${replaceStrings ["/"] ["_"] plan.path}"; name = "permown.${replaceStrings ["/"] ["_"] plan.path}";
value = { value = {