CPU Throttling Fix
This commit is contained in:
parent
191e8803c9
commit
bfe2fc6c0a
@ -17,12 +17,14 @@ in {
|
|||||||
./hacks.nix
|
./hacks.nix
|
||||||
./docker.nix
|
./docker.nix
|
||||||
./home-manager.nix
|
./home-manager.nix
|
||||||
|
./thinkpad.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
time.timeZone = "UTC";
|
time.timeZone = "UTC";
|
||||||
|
|
||||||
boot.kernelPackages = unstable.linuxPackages_latest;
|
boot.kernelPackages = unstable.linuxPackages_latest;
|
||||||
boot.blacklistedKernelModules = [ "nouveau" ];
|
boot.blacklistedKernelModules = [ "nouveau" ];
|
||||||
|
boot.earlyVconsoleSetup = true;
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
27
thinkpad.nix
Normal file
27
thinkpad.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# https://github.com/NixOS/nixos-hardware/blob/master/common/pc/laptop/cpu-throttling-bug.nix
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
systemd.services.cpu-throttling = {
|
||||||
|
enable = true;
|
||||||
|
description = "CPU Throttling Fix";
|
||||||
|
path = [ pkgs.msr-tools ];
|
||||||
|
script = "wrmsr -a 0x1a2 0x3000000";
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
wantedBy = [
|
||||||
|
"timers.target"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.cpu-throttling = {
|
||||||
|
enable = true;
|
||||||
|
description = "CPU Throttling Fix";
|
||||||
|
timerConfig = {
|
||||||
|
OnActiveSec = 60;
|
||||||
|
OnUnitActiveSec = 60;
|
||||||
|
Unit = "cpu-throttling.service";
|
||||||
|
};
|
||||||
|
wantedBy = [
|
||||||
|
"timers.target"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user