From 324e4b68d5565e7fdcbfa3626eb07d32d15f655a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 17 Mar 2020 16:22:58 +0100 Subject: thinkpad: enable fan control --- system/settings/hardware/thinkpad.nix | 7 +++++++ system/settings/machines/t470s.nix | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'system/settings') diff --git a/system/settings/hardware/thinkpad.nix b/system/settings/hardware/thinkpad.nix index e4ddb829..4f4e6b8c 100644 --- a/system/settings/hardware/thinkpad.nix +++ b/system/settings/hardware/thinkpad.nix @@ -2,11 +2,18 @@ { boot.kernelModules = [ ]; boot.blacklistedKernelModules = [ "thinkpad_ec" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + acpi_call + ]; services.fwupd = { enable = true; }; + services.thinkfan = { + enable = true; + }; + imports = [ ./bare-metal.nix ./laptop.nix diff --git a/system/settings/machines/t470s.nix b/system/settings/machines/t470s.nix index 34fdd048..7790ce28 100644 --- a/system/settings/machines/t470s.nix +++ b/system/settings/machines/t470s.nix @@ -5,6 +5,25 @@ hardware.enableRedistributableFirmware = true; + boot.extraModprobeConfig = '' + options thinkpad_acpi fan_control=1 + ''; + + services.thinkfan.sensors = '' + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input + hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input + ''; + services.thinkfan.levels = '' + (0, 0, 48) + (1, 45, 52) + (2, 50, 57) + (3, 55, 63) + (6, 60, 65) + (7, 60, 85) + (127, 80, 32767) + ''; + boot.postBootCommands = '' echo bfq > /sys/block/nvme0n1/queue/scheduler ''; -- cgit 1.4.1