laptop: move thinkfan options into separate file and adjust levels

This commit is contained in:
Lgmrszd 2025-05-14 06:24:47 +04:00
parent cfdff1e2b6
commit c96b8201b5
No known key found for this signature in database
GPG key ID: 9396B8BA6FBB14DE
2 changed files with 104 additions and 103 deletions

View file

@ -10,6 +10,7 @@ in
{ {
imports = [ imports = [
./thinkfan.nix
./mounts.nix ./mounts.nix
./akkotest.nix ./akkotest.nix
]; ];
@ -303,109 +304,6 @@ in
#media-session.enable = true; #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). # Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true; services.libinput.enable = true;

103
hosts/laptop/thinkfan.nix Normal file
View file

@ -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]
];
};
}