2024-11-19 14:18:32 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2020-09-03 02:36:09 +02:00
|
|
|
|
|
|
|
{
|
2024-01-05 21:30:49 +01:00
|
|
|
# Enable power-profiles-daemon
|
|
|
|
services.power-profiles-daemon.enable = true;
|
2022-04-16 00:08:57 +02:00
|
|
|
|
2024-01-24 00:26:32 +01:00
|
|
|
# Suspend when the battery is critical
|
2021-02-17 03:50:33 +01:00
|
|
|
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"
|
|
|
|
'';
|
2020-09-03 02:36:09 +02:00
|
|
|
}
|