summary refs log tree commit diff stats
path: root/system/settings
diff options
context:
space:
mode:
authorAlan Pearce2025-03-13 14:48:48 +0100
committerAlan Pearce2025-03-13 14:48:48 +0100
commit94e7b5667ca7b4c38b73f1dcce20c714cfe8981d (patch)
tree16707c89011516503e00951a18d70558fd4729d7 /system/settings
parentded3ac5dff9c51fff90c5dffb111894e318ea3e3 (diff)
downloadnixfiles-94e7b5667ca7b4c38b73f1dcce20c714cfe8981d.tar.lz
nixfiles-94e7b5667ca7b4c38b73f1dcce20c714cfe8981d.tar.zst
nixfiles-94e7b5667ca7b4c38b73f1dcce20c714cfe8981d.zip
colmena: support running arbitrary commands before updating
Diffstat (limited to 'system/settings')
-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}"
           ''