commit e2f073af604c9ed61f253a4b11aba2082f8f93e0
parent 47b57be1529ef9ae95b669248202a6ed40ecbd5f
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 3 Sep 2021 15:31:00 +0200
systems/naruhodo: hibernate on critical battery level
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/systems/hosts/naruhodo.nix b/systems/hosts/naruhodo.nix
@@ -137,6 +137,10 @@ in
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \
MODE:="0666", \
SYMLINK+="stm32_dfu"
+
+
+ # Suspend the system when battery level drops to 5% or lower
+ SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="${pkgs.systemd}/bin/systemctl hibernate"
'';
services.hardware.bolt.enable = true;
core.nix = {