phhoebe: attempt to add 80% battery charge control
This commit is contained in:
parent
e84677dc87
commit
39548aafab
1 changed files with 13 additions and 0 deletions
|
@ -54,4 +54,17 @@
|
|||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
|
||||
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'";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Reference in a new issue