panacea/modules/power.nix

12 lines
366 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
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
# 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"
'';
}