Merge pull request #40768 from CommunicationAnimale/master

nixos/thinkfan: use non-deprecated keywords in config file.

authored by

Pascal Wittmann and committed by
GitHub
c271ebdd 1a6af9f8

+46 -9
+46 -9
nixos/modules/services/hardware/thinkfan.nix
··· 28 28 # temperatures are read from the file. 29 29 # 30 30 # For example: 31 - # sensor /proc/acpi/ibm/thermal (0, 0, 10) 31 + # tp_thermal /proc/acpi/ibm/thermal (0, 0, 10) 32 32 # will add a fixed value of 10 °C the 3rd value read from that file. Check out 33 33 # http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may 34 34 # want to add to certain temperatures. 35 - 35 + 36 + ${cfg.fan} 37 + ${cfg.sensors} 38 + 36 39 # Syntax: 37 40 # (LEVEL, LOW, HIGH) 38 41 # LEVEL is the fan level to use (0-7 with thinkpad_acpi) ··· 41 44 # All numbers are integers. 42 45 # 43 46 44 - sensor ${cfg.sensor} (0, 10, 15, 2, 10, 5, 0, 3, 0, 3) 45 - 46 47 ${cfg.levels} 47 48 ''; 48 49 ··· 53 54 services.thinkfan = { 54 55 55 56 enable = mkOption { 57 + type = types.bool; 56 58 default = false; 57 59 description = '' 58 60 Whether to enable thinkfan, fan controller for IBM/Lenovo ThinkPads. 59 61 ''; 60 62 }; 61 63 62 - sensor = mkOption { 63 - default = "/proc/acpi/ibm/thermal"; 64 + sensors = mkOption { 65 + type = types.lines; 66 + default = '' 67 + tp_thermal /proc/acpi/ibm/thermal (0,0,10) 68 + ''; 69 + description ='' 70 + thinkfan can read temperatures from three possible sources: 71 + 72 + /proc/acpi/ibm/thermal 73 + Which is provided by the thinkpad_acpi kernel 74 + module (keyword tp_thermal) 75 + 76 + /sys/class/hwmon/*/temp*_input 77 + Which may be provided by any hwmon drivers (keyword 78 + hwmon) 79 + 80 + S.M.A.R.T. (since 0.9 and requires the USE_ATASMART compilation flag) 81 + Which reads the temperature directly from the hard 82 + disk using libatasmart (keyword atasmart) 83 + 84 + Multiple sensors may be added, in which case they will be 85 + numbered in their order of appearance. 86 + ''; 87 + }; 88 + 89 + fan = mkOption { 90 + type = types.str; 91 + default = "tp_fan /proc/acpi/ibm/fan"; 64 92 description ='' 65 - Sensor used by thinkfan 93 + Specifies the fan we want to use. 94 + On anything other than a Thinkpad you'll probably 95 + use some PWM control file in /sys/class/hwmon. 96 + A sysfs fan would be specified like this: 97 + pwm_fan /sys/class/hwmon/hwmon2/device/pwm1 66 98 ''; 67 99 }; 68 100 69 101 levels = mkOption { 102 + type = types.lines; 70 103 default = '' 71 104 (0, 0, 55) 72 105 (1, 48, 60) ··· 76 109 (7, 60, 85) 77 110 (127, 80, 32767) 78 111 ''; 79 - description ='' 80 - Sensor used by thinkfan 112 + description = '' 113 + (LEVEL, LOW, HIGH) 114 + LEVEL is the fan level to use (0-7 with thinkpad_acpi). 115 + LOW is the temperature at which to step down to the previous level. 116 + HIGH is the temperature at which to step up to the next level. 117 + All numbers are integers. 81 118 ''; 82 119 }; 83 120