dotfiles/modules/nixos/hardware/tlp/default.nix
alejandro-angulo b9b996bd66
Cleanup
Addressed some things nixd complained about
2024-08-03 10:32:02 -07:00

28 lines
579 B
Nix

{
config,
lib,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.aa.hardware.tlp;
in {
options.aa.hardware.tlp = {
enable = mkEnableOption "tlp";
};
config = mkIf cfg.enable {
services.tlp = {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 75;
# Run `tlp fullcharge` 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";
};
};
};
}