summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2025-03-11 08:26:06 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2025-03-11 08:26:06 +0100
commitb8a82469261c88c6d752bea031642a3727d64e3a (patch)
tree0f044343dda6780211e1c67a56521860f7e6f9ba /modules
parente63906e640104a50cdc1bdd287538e130d46f4bd (diff)
nixos: autoUpgrade: flakes: remove refresh flag
Diffstat (limited to 'modules')
-rw-r--r--modules/nixos/personal/nix.nix11
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
{