Configured tlp for laptop

This commit is contained in:
Alejandro Angulo 2023-06-09 18:05:29 -07:00
parent 9a26dbd5f3
commit c1e24c6e15
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,29 @@
{
options,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.aa.hardware.tlp;
in {
options.aa.hardware.tlp = with types; {
enable = mkEnableOption "tlp";
};
config = mkIf cfg.enable {
services.tlp = {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 75;
# Run `tlp setcharge` to temporarily allow charging to 100%
STOP_CHARGE_THRESH_BAT0 = 80;
RESTORE_THRESHOLDS_ON_BAT = 1;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
};
};
};
}

View file

@ -21,6 +21,7 @@
};
hardware.audio.enable = true;
hardware.tlp.enable = true;
system.zfs.enable = true;
apps.yubikey.enable = true;