2023-06-10 01:05:29 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2024-08-03 17:32:02 +00:00
|
|
|
}: let
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
|
|
|
|
2023-06-10 01:05:29 +00:00
|
|
|
cfg = config.aa.hardware.tlp;
|
|
|
|
in {
|
2024-08-03 17:32:02 +00:00
|
|
|
options.aa.hardware.tlp = {
|
2023-06-10 01:05:29 +00:00
|
|
|
enable = mkEnableOption "tlp";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.tlp = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
START_CHARGE_THRESH_BAT0 = 75;
|
2024-03-15 14:47:10 +00:00
|
|
|
# Run `tlp fullcharge` to temporarily allow charging to 100%
|
2023-06-10 01:05:29 +00:00
|
|
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
|
|
|
RESTORE_THRESHOLDS_ON_BAT = 1;
|
|
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|