diff --git a/utils/modules/autoupgrade.nix b/utils/modules/autoupgrade.nix index aabfc06..8c34a37 100644 --- a/utils/modules/autoupgrade.nix +++ b/utils/modules/autoupgrade.nix @@ -1,6 +1,13 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: { system.autoUpgrade.enable = true; system.autoUpgrade.allowReboot = false; + + # Skip auto-upgrade when on battery to save power + systemd.services.nixos-upgrade = { + unitConfig = { + ConditionACPower = true; + }; + }; }