From 9352d93b79c765a4e4a8307b9224cb3ccf228fb7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 18 Sep 2023 14:36:30 +0800 Subject: [PATCH] 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. --- modules/home-manager/files/mutable-files.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/home-manager/files/mutable-files.nix b/modules/home-manager/files/mutable-files.nix index d9eca051..6ea5ff52 100644 --- a/modules/home-manager/files/mutable-files.nix +++ b/modules/home-manager/files/mutable-files.nix @@ -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;