97fc6fc0de
- asus : charge control - audio : pipewire - hardware : boot, encryption etc
23 lines
609 B
Nix
23 lines
609 B
Nix
{ pkgs, ... }:
|
|
{
|
|
services.asusd = {
|
|
enable = true;
|
|
asusdConfig =
|
|
''
|
|
"bat_charge_limit": 80,
|
|
'';
|
|
};
|
|
|
|
systemd.services.battery-charge-threshold = {
|
|
wantedBy = [ "local-fs.target" "suspend.target" ];
|
|
after = [ "local-fs.target" "suspend.target" ];
|
|
description = "Set the battery charge threshold to 80%";
|
|
startLimitBurst = 5;
|
|
startLimitIntervalSec = 1;
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
Restart = "on-failure";
|
|
ExecStart = "${pkgs.runtimeShell} -c 'echo 80 > /sys/class/power_supply/BAT?/charge_control_end_threshold'";
|
|
};
|
|
};
|
|
}
|