nixos: autoUpgrade: allow disabling flake upgrades (#409185)

authored by Arnout Engelen and committed by GitHub 6ac3a69b 830349f3

+11 -1
+11 -1
nixos/modules/tasks/auto-upgrade.nix
··· 61 ''; 62 }; 63 64 flags = lib.mkOption { 65 type = lib.types.listOf lib.types.str; 66 default = [ ]; ··· 235 date = "${pkgs.coreutils}/bin/date"; 236 readlink = "${pkgs.coreutils}/bin/readlink"; 237 shutdown = "${config.systemd.package}/bin/shutdown"; 238 - upgradeFlag = lib.optional (cfg.channel == null) "--upgrade"; 239 in 240 if cfg.allowReboot then 241 ''
··· 61 ''; 62 }; 63 64 + upgrade = lib.mkOption { 65 + type = lib.types.bool; 66 + default = true; 67 + description = '' 68 + Disable adding the `--upgrade` parameter when `channel` 69 + is not set, such as when upgrading to the latest version 70 + of a flake honouring its lockfile. 71 + ''; 72 + }; 73 + 74 flags = lib.mkOption { 75 type = lib.types.listOf lib.types.str; 76 default = [ ]; ··· 245 date = "${pkgs.coreutils}/bin/date"; 246 readlink = "${pkgs.coreutils}/bin/readlink"; 247 shutdown = "${config.systemd.package}/bin/shutdown"; 248 + upgradeFlag = lib.optional (cfg.channel == null && cfg.upgrade) "--upgrade"; 249 in 250 if cfg.allowReboot then 251 ''