nix/module/PowersaveAmd.nix

22 lines
538 B
Nix
Raw Normal View History

# AMD CPU boost control.
{ pkgs, ... } @args: let
controlFile = "/sys/devices/system/cpu/cpufreq/boost";
2024-05-06 23:21:25 +03:00
enable = "0";
disable = "1";
script = pkgs.writeShellScriptBin "powersave" (import ./powersave/Script.nix {
2024-05-12 02:40:37 +03:00
inherit controlFile enable disable;
}).script;
in {
# Requirements:
# CPPC (Collaborative Power Control) - Disabled.
# PSS (Cool and Quiet) - Enabled.
imports = [
(import ./powersave ({
2024-05-12 02:40:37 +03:00
inherit controlFile enable disable;
} // args))
];
environment.systemPackages = [ script ];
}