diff options
Diffstat (limited to 'system/settings/colmena-auto-upgrade.nix')
-rw-r--r-- | system/settings/colmena-auto-upgrade.nix | 24 |
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 '' |