diff --git a/modules/power.nix b/modules/power.nix index 367f8fd..3e2f52d 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -37,11 +37,8 @@ }; }; - # Suspend to RAM/disk when battery is critical - services.upower = { - enable = true; - percentageLow = 15; - percentageCritical = 10; - percentageAction = 7; - }; + # Suspend when the battery is critical + services.udev.extraRules = '' + SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{model_name}=="01AV405", ATTR{capacity}=="[0-5]", RUN+="${config.systemd.package}/bin/systemctl suspend -i" + ''; }