mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 09:47:52 +00:00
24 lines
611 B
Nix
24 lines
611 B
Nix
{config, pkgs, lib, ...}:
|
|
with lib;
|
|
let
|
|
generalCfg = config.aviallon.general;
|
|
throttledService = "lenovo_fix";
|
|
in {
|
|
config = mkIf (generalCfg.cpu.vendor == "intel") {
|
|
aviallon.boot.cmdline = {
|
|
"intel_pstate" = "passive";
|
|
};
|
|
|
|
services.throttled.enable = generalCfg.unsafeOptimizations;
|
|
services.thermald.enable = true;
|
|
|
|
systemd.services.${throttledService} = {
|
|
bindsTo = [ "ac-power.target" ];
|
|
conflicts = [ "thermald.service" ];
|
|
};
|
|
|
|
systemd.services.thermald = mkIf config.services.thermald.enable {
|
|
wantedBy = [ "battery-power.target" ];
|
|
};
|
|
};
|
|
}
|