mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos: autoUpgrade: allow disabling flake upgrades (#409185)
This commit is contained in:
commit
6ac3a69b20
1 changed files with 11 additions and 1 deletions
|
@ -61,6 +61,16 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
upgrade = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Disable adding the `--upgrade` parameter when `channel`
|
||||||
|
is not set, such as when upgrading to the latest version
|
||||||
|
of a flake honouring its lockfile.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
flags = lib.mkOption {
|
flags = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
@ -235,7 +245,7 @@ in
|
||||||
date = "${pkgs.coreutils}/bin/date";
|
date = "${pkgs.coreutils}/bin/date";
|
||||||
readlink = "${pkgs.coreutils}/bin/readlink";
|
readlink = "${pkgs.coreutils}/bin/readlink";
|
||||||
shutdown = "${config.systemd.package}/bin/shutdown";
|
shutdown = "${config.systemd.package}/bin/shutdown";
|
||||||
upgradeFlag = lib.optional (cfg.channel == null) "--upgrade";
|
upgradeFlag = lib.optional (cfg.channel == null && cfg.upgrade) "--upgrade";
|
||||||
in
|
in
|
||||||
if cfg.allowReboot then
|
if cfg.allowReboot then
|
||||||
''
|
''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue