From cfdff1e2b6bb300c805a50c7fb51ffb30556777c Mon Sep 17 00:00:00 2001 From: Lgmrszd Date: Sun, 11 May 2025 00:35:36 +0400 Subject: [PATCH] laptop: add thinkfan --- hosts/laptop/configuration.nix | 98 ++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 29213dc..a75a63c 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -305,6 +305,104 @@ in services.thinkfan = { enable = true; + # https://wiki.archlinux.org/title/Lenovo_ThinkPad_P15_Gen_1 + sensors = [ + # # NVIDIA GPU + # { + # query = "01:00.0"; + # type = "nvml"; + # } + # acpitz + # crit = 128°C + { + query = "/sys/class/hwmon"; + type = "hwmon"; + name = "acpitz"; + indices = [1]; + correction = [0]; + } + # pch_cometlake + { + query = "/sys/devices/virtual/thermal"; + type = "hwmon"; + name = "pch_cometlake"; + indices = [1]; + correction = [0]; + } + # # nvme + # # high = 85°C + # { + # query = "/sys/devices/pci0000:00/0000:00:1d.0/0000:55:00.0/nvme/nvme1"; + # type = "hwmon"; + # name = "nvme"; + # indices = [2 3]; + # correction = [0 0]; + # } + # # nvme + # # high = 85°C + # { + # query = "/sys/devices/pci0000:00/0000:00:1b.0/0000:02:00.0/nvme/nvme0"; + # type = "hwmon"; + # name = "nvme"; + # indices = [2 3]; + # correction = [0 0]; + # } + # coretemp + # high = 100°C, crit = 100°C. + { + query = "/sys/devices/platform/coretemp.0/hwmon"; + type = "hwmon"; + name = "coretemp"; + indices = [1 2 3 4 5 6 7 8 9]; + correction = [0 0 0 0 0 0 0 0 0]; + } + # thinkpad + { + query = "/sys/devices/platform/thinkpad_hwmon/hwmon"; + type = "hwmon"; + indices = [1 2 3 4 5 6]; + correction = [0 0 0 0 0 0]; + } + # thinkpad + { + query = "/sys/devices/platform/thinkpad_hwmon/hwmon"; + type = "hwmon"; + indices = [7]; + correction = [0]; + } + # thinkpad + { + query = "/sys/devices/platform/thinkpad_hwmon/hwmon"; + type = "hwmon"; + optional = true; + indices = [8]; + correction = [0]; + } + # iwlwifi_1 + { + query = "/sys/class/hwmon"; + type = "hwmon"; + name = "iwlwifi_1"; + optional = true; + indices = [1]; + correction = [0]; + } + ]; + fans = [ + { + query = "/proc/acpi/ibm/fan"; + type = "tpacpi"; + } + ]; + levels = [ + [0 0 60] + [2 60 65] + [3 65 70] + [5 70 75] + [6 75 80] + [7 80 85] + ["level disengaged" 85 255] + ]; };