diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2025-03-11 08:26:06 +0100 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2025-03-11 08:26:06 +0100 |
| commit | b8a82469261c88c6d752bea031642a3727d64e3a (patch) | |
| tree | 0f044343dda6780211e1c67a56521860f7e6f9ba /modules/nixos/personal/nix.nix | |
| parent | e63906e640104a50cdc1bdd287538e130d46f4bd (diff) | |
nixos: autoUpgrade: flakes: remove refresh flag
Diffstat (limited to 'modules/nixos/personal/nix.nix')
| -rw-r--r-- | modules/nixos/personal/nix.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/nixos/personal/nix.nix b/modules/nixos/personal/nix.nix index 763d5d1..5a79e06 100644 --- a/modules/nixos/personal/nix.nix +++ b/modules/nixos/personal/nix.nix @@ -130,7 +130,6 @@ in { personal.boot.unattendedReboot = lib.mkIf config.system.autoUpgrade.allowReboot true; system.autoUpgrade = { enable = true; - flake = cfg.flake; flags = lib.optional (!hasFlake) "--upgrade-all"; }; systemd.services.nixos-upgrade = lib.mkMerge [ @@ -164,6 +163,16 @@ in { }) (lib.mkIf hasFlake { + # don't use system.autoUpgrade.flake, as it enables the --refresh flag + assertions = [ + { + assertion = !((config.system.autoUpgrade.channel != null)); + message = '' + The options 'system.autoUpgrade.channel' and 'personal.nix.flake' cannot both be set. + ''; + } + ]; + system.autoUpgrade.flags = ["--flags ${cfg.flake}"]; systemd.services.flake-update = lib.mkIf hasFlakeInputs (lib.mkMerge [ checkNetwork { |
