summary refs log tree commit diff stats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/settings/colmena-auto-upgrade.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/system/settings/colmena-auto-upgrade.nix b/system/settings/colmena-auto-upgrade.nix
index 98168401..b9b84e88 100644
--- a/system/settings/colmena-auto-upgrade.nix
+++ b/system/settings/colmena-auto-upgrade.nix
@@ -77,6 +77,15 @@ in
       };
     };
 
+    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 @@ in
             ${git} checkout ${cfg.git.branch}
             ''
           }
+
+          ${cfg.preUpgradeHook}
+
           ${if cfg.useNixShell then ''
             ${nix-shell} --run "${pkgs.writeShellScript "colmena-auto-upgrade" mainScript}"
           ''