summary refs log tree commit diff stats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/linde.nix5
-rw-r--r--system/settings/colmena-auto-upgrade.nix24
2 files changed, 19 insertions, 10 deletions
diff --git a/system/linde.nix b/system/linde.nix
index 03eb5761..124167c4 100644
--- a/system/linde.nix
+++ b/system/linde.nix
@@ -112,7 +112,10 @@ in
 
   services.colmenaAutoUpgrade = {
     enable = true;
-    pullGit = true;
+    git = {
+      enable = true;
+      branch = "origin/main";
+    };
     useNixShell = true;
     dates = "03:23";
     allowReboot = true;
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 ''