all repos — nixfiles @ 94e7b5667ca7b4c38b73f1dcce20c714cfe8981d

System and user configuration, managed by nix and home-manager

colmena: support running arbitrary commands before updating

Alan Pearce
commit

94e7b5667ca7b4c38b73f1dcce20c714cfe8981d

parent

ded3ac5dff9c51fff90c5dffb111894e318ea3e3

1 file changed, 12 insertions(+), 0 deletions(-)

jump to
M system/settings/colmena-auto-upgrade.nixsystem/settings/colmena-auto-upgrade.nix
@@ -77,6 +77,15 @@ };
}; }; + preUpgradeHook = lib.mkOption { + type = lib.types.str; + default = ""; + description = "Commands to run before upgrade"; + example = lib.literalExpression '' + $${pkgs.npins}/bin/npins update + ''; + }; + useNixShell = lib.mkOption { default = false; type = lib.types.bool;
@@ -221,6 +230,9 @@ ${git} fetch --prune
${git} checkout ${cfg.git.branch} '' } + + ${cfg.preUpgradeHook} + ${if cfg.useNixShell then '' ${nix-shell} --run "${pkgs.writeShellScript "colmena-auto-upgrade" mainScript}" ''