services: add TLP
This commit is contained in:
parent
faad0c0624
commit
9a9d0ba266
|
@ -22,6 +22,7 @@
|
|||
./rss-bridge.nix
|
||||
./sabnzbd.nix
|
||||
./ssh-server.nix
|
||||
./tlp.nix
|
||||
./transmission.nix
|
||||
./wireguard.nix
|
||||
];
|
||||
|
|
22
services/tlp.nix
Normal file
22
services/tlp.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
# TLP power management
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.tlp;
|
||||
in
|
||||
{
|
||||
options.my.services.tlp = {
|
||||
enable = lib.mkEnableOption "TLP power management configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
# Keep charge between 60% and 80% to preserve battery life
|
||||
START_CHARGE_THRESH_BAT0 = 60;
|
||||
STOP_CHARGE_THRESH_BAT0 = 80;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue