files/mutable-files: add postScript sub-option

This should make it easier to add shell script fragments after each
download such as installation of Doom Emacs.
This commit is contained in:
Gabriel Arazas 2023-09-18 14:36:30 +08:00
parent 89586650f4
commit 9352d93b79
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -68,6 +68,17 @@ let
default = [ ];
example = [ "--depth" "1" ];
};
postScript = lib.mkOption {
type = lib.types.str;
description = ''
A shell script fragment to be executed after the download.
'';
default = "";
example = lib.literalExpression ''
$${config.xdg.configHome}/emacs/bin/doom install --no-config --no-fonts --install --force
'';
};
};
};
in
@ -139,6 +150,7 @@ in
[ -e ${path} ] || gopass clone ${extraArgs} ${url} --path ${path} ${extraArgs}
''}
${isFetchType "custom" "[ -e ${path} ] || ${extraArgs}"}
${value.postScript}
'')
cfg;