diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index a75a63c..b67e44b 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -10,6 +10,7 @@ in { imports = [ + ./thinkfan.nix ./mounts.nix ./akkotest.nix ]; @@ -303,109 +304,6 @@ in #media-session.enable = true; }; - 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] - ]; - }; - - # Enable touchpad support (enabled default in most desktopManager). services.libinput.enable = true; diff --git a/hosts/laptop/thinkfan.nix b/hosts/laptop/thinkfan.nix new file mode 100644 index 0000000..472c073 --- /dev/null +++ b/hosts/laptop/thinkfan.nix @@ -0,0 +1,103 @@ +{ + 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 58 67] + [3 63 72] + [5 68 77] + [6 73 82] + [7 78 83] + ["level disengaged" 80 255] + ]; + }; +} \ No newline at end of file