From f4fb1e159c422fbc966bf6631b907036304699d0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 18 Aug 2024 23:53:17 +0200 Subject: ... --- hosts/vidhar/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hosts/vidhar/default.nix') diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 440829bb..78f305f8 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix @@ -132,6 +132,18 @@ with lib; CPUQuota = "2000%"; }; }; + systemd.services."limit-pstate" = { + wantedBy = ["basic.target"]; + serviceConfig = { + ExecStart = pkgs.writeShellScript "limit-pstate-start" '' + echo 80 > /sys/devices/system/cpu/intel_pstate/max_perf_pct + ''; + RemainAfterExit = true; + ExecStop = pkgs.writeShellScript "limit-pstate-stop" '' + echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct + ''; + }; + }; powerManagement = { enable = true; -- cgit v1.2.3