From 40743442e91b591bfba079bf0435f09e11ce719a Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sun, 19 Oct 2025 13:31:31 +0200 Subject: [PATCH] fix: use autoupgrade only on AC --- utils/modules/autoupgrade.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; + }; + }; }