This commit is contained in:
2026-02-14 18:23:59 +00:00
parent b99ccfc588
commit 5a8bd09491
11 changed files with 504 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
{ den, modules, ... }:
{
modules.battery-ac-targets = {
nixos =
{ ... }:
{
services.udev.extraRules = ''
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/run/current-system/systemd/bin/systemctl start battery.target"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/run/current-system/systemd/bin/systemctl start ac.target"
'';
};
};
}