mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
30 lines
620 B
Nix
30 lines
620 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
generalCfg = config.aviallon.general;
|
|
throttledService = "throttled";
|
|
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" ];
|
|
};
|
|
};
|
|
}
|