summary refs log tree commit diff stats
path: root/system/settings
diff options
context:
space:
mode:
authorAlan Pearce2025-03-13 14:39:12 +0100
committerAlan Pearce2025-03-13 14:39:12 +0100
commitded3ac5dff9c51fff90c5dffb111894e318ea3e3 (patch)
treeaec92a97e5c1fdf22dbdae0981676361dcec7bb6 /system/settings
parentc81219b243e67489dd92a6d9d23cd0e77ee3a153 (diff)
downloadnixfiles-ded3ac5dff9c51fff90c5dffb111894e318ea3e3.tar.lz
nixfiles-ded3ac5dff9c51fff90c5dffb111894e318ea3e3.tar.zst
nixfiles-ded3ac5dff9c51fff90c5dffb111894e318ea3e3.zip
linde/colmena: enable configuration of checked out branch
Diffstat (limited to 'system/settings')
-rw-r--r--system/settings/colmena-auto-upgrade.nix24
1 files changed, 15 insertions, 9 deletions
diff --git a/system/settings/colmena-auto-upgrade.nix b/system/settings/colmena-auto-upgrade.nix
index add141b6..98168401 100644
--- a/system/settings/colmena-auto-upgrade.nix
+++ b/system/settings/colmena-auto-upgrade.nix
@@ -63,12 +63,18 @@ in
       description = "Enable automatic upgrades for Colmena";
     };
 
-    pullGit = lib.mkOption {
-      default = false;
-      type = lib.types.bool;
-      description = ''
-        Whether to pull the latest changes from the Git repository before upgrading.
-      '';
+    git = lib.mkOption {
+      type = lib.types.submodule {
+        options = {
+          enable = lib.mkEnableOption "Whether to pull the latest changes from the Git repository before upgrading.";
+
+          branch = lib.mkOption {
+            type = lib.types.str;
+            default = "origin/main";
+            description = "Git branch to checkout after fetching";
+          };
+        };
+      };
     };
 
     useNixShell = lib.mkOption {
@@ -209,10 +215,10 @@ in
           nix-shell = "${pkgs.nix}/bin/nix-shell";
         in
         ''
-          ${lib.optionalString cfg.pullGit
+          ${lib.optionalString cfg.git.enable
             ''
-            ${git} fetch --all --prune
-            ${git} checkout FETCH_HEAD
+            ${git} fetch --prune
+            ${git} checkout ${cfg.git.branch}
             ''
           }
           ${if cfg.useNixShell then ''