Add thinkpad-specific throttling

This commit is contained in:
Cyryl Płotnicki 2019-07-06 12:03:30 +01:00
parent 3a8e4b48f9
commit ade1f149b7

View file

@ -29,6 +29,42 @@
hardware.bumblebee.enable = true; hardware.bumblebee.enable = true;
hardware.bumblebee.connectDisplay = true; hardware.bumblebee.connectDisplay = true;
hardware.trackpoint.enable = true;
services.fprintd.enable = true;
systemd.services.cpu-throttling = {
enable = true;
description = "CPU Throttling Fix";
documentation = [
"https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Power_management.2FThrottling_issues"
];
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";
documentation = [
"https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Power_management.2FThrottling_issues"
];
timerConfig = {
OnActiveSec = 60;
OnUnitActiveSec = 60;
Unit = "cpu-throttling.service";
};
wantedBy = [
"timers.target"
];
};
imports = [ imports = [
/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
../boot.nix ../boot.nix