mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Hardware/Intel] Add throttled and thermald to improve performance and reduce thermal issues
This commit is contained in:
parent
127117d52e
commit
c6008b5387
1 changed files with 13 additions and 0 deletions
|
|
@ -2,10 +2,23 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
generalCfg = config.aviallon.general;
|
generalCfg = config.aviallon.general;
|
||||||
|
throttledService = "lenovo_fix";
|
||||||
in {
|
in {
|
||||||
config = mkIf (generalCfg.cpuVendor == "intel") {
|
config = mkIf (generalCfg.cpuVendor == "intel") {
|
||||||
aviallon.boot.cmdline = {
|
aviallon.boot.cmdline = {
|
||||||
"intel_pstate" = "passive";
|
"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" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue