From b8a82469261c88c6d752bea031642a3727d64e3a Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Tue, 11 Mar 2025 08:26:06 +0100 Subject: nixos: autoUpgrade: flakes: remove refresh flag --- modules/nixos/personal/nix.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/nixos/personal/nix.nix') 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 { -- cgit v1.2.3