summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
{