[Hardware/Intel] Add throttled and thermald to improve performance and reduce thermal issues

This commit is contained in:
Antoine Viallon 2023-04-20 19:05:51 +02:00
parent 127117d52e
commit c6008b5387
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -2,10 +2,23 @@
with lib;
let
generalCfg = config.aviallon.general;
throttledService = "lenovo_fix";
in {
config = mkIf (generalCfg.cpuVendor == "intel") {
aviallon.boot.cmdline = {
"intel_pstate" = "passive";
};
services.throttled.enable = generalCfg.unsafeOptimizations;
services.thermald.enable = !generalCfg.unsafeOptimizations;
systemd.services.${throttledService} = {
bindsTo = [ "ac-power.target" ];
conflicts = [ "thermald.service" ];
};
systemd.services.thermald = {
wantedBy = [ "battery-power.target" ];
};
};
}