forked from mirrors/nixpkgs
Merge pull request #40768 from CommunicationAnimale/master
nixos/thinkfan: use non-deprecated keywords in config file.
This commit is contained in:
commit
c271ebdde7
|
@ -28,11 +28,14 @@ let
|
||||||
# temperatures are read from the file.
|
# temperatures are read from the file.
|
||||||
#
|
#
|
||||||
# For example:
|
# For example:
|
||||||
# sensor /proc/acpi/ibm/thermal (0, 0, 10)
|
# tp_thermal /proc/acpi/ibm/thermal (0, 0, 10)
|
||||||
# will add a fixed value of 10 °C the 3rd value read from that file. Check out
|
# will add a fixed value of 10 °C the 3rd value read from that file. Check out
|
||||||
# http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may
|
# http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may
|
||||||
# want to add to certain temperatures.
|
# want to add to certain temperatures.
|
||||||
|
|
||||||
|
${cfg.fan}
|
||||||
|
${cfg.sensors}
|
||||||
|
|
||||||
# Syntax:
|
# Syntax:
|
||||||
# (LEVEL, LOW, HIGH)
|
# (LEVEL, LOW, HIGH)
|
||||||
# LEVEL is the fan level to use (0-7 with thinkpad_acpi)
|
# LEVEL is the fan level to use (0-7 with thinkpad_acpi)
|
||||||
|
@ -41,8 +44,6 @@ let
|
||||||
# All numbers are integers.
|
# All numbers are integers.
|
||||||
#
|
#
|
||||||
|
|
||||||
sensor ${cfg.sensor} (0, 10, 15, 2, 10, 5, 0, 3, 0, 3)
|
|
||||||
|
|
||||||
${cfg.levels}
|
${cfg.levels}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -53,20 +54,52 @@ in {
|
||||||
services.thinkfan = {
|
services.thinkfan = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable thinkfan, fan controller for IBM/Lenovo ThinkPads.
|
Whether to enable thinkfan, fan controller for IBM/Lenovo ThinkPads.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
sensor = mkOption {
|
sensors = mkOption {
|
||||||
default = "/proc/acpi/ibm/thermal";
|
type = types.lines;
|
||||||
|
default = ''
|
||||||
|
tp_thermal /proc/acpi/ibm/thermal (0,0,10)
|
||||||
|
'';
|
||||||
description =''
|
description =''
|
||||||
Sensor used by thinkfan
|
thinkfan can read temperatures from three possible sources:
|
||||||
|
|
||||||
|
/proc/acpi/ibm/thermal
|
||||||
|
Which is provided by the thinkpad_acpi kernel
|
||||||
|
module (keyword tp_thermal)
|
||||||
|
|
||||||
|
/sys/class/hwmon/*/temp*_input
|
||||||
|
Which may be provided by any hwmon drivers (keyword
|
||||||
|
hwmon)
|
||||||
|
|
||||||
|
S.M.A.R.T. (since 0.9 and requires the USE_ATASMART compilation flag)
|
||||||
|
Which reads the temperature directly from the hard
|
||||||
|
disk using libatasmart (keyword atasmart)
|
||||||
|
|
||||||
|
Multiple sensors may be added, in which case they will be
|
||||||
|
numbered in their order of appearance.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
fan = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "tp_fan /proc/acpi/ibm/fan";
|
||||||
|
description =''
|
||||||
|
Specifies the fan we want to use.
|
||||||
|
On anything other than a Thinkpad you'll probably
|
||||||
|
use some PWM control file in /sys/class/hwmon.
|
||||||
|
A sysfs fan would be specified like this:
|
||||||
|
pwm_fan /sys/class/hwmon/hwmon2/device/pwm1
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
levels = mkOption {
|
levels = mkOption {
|
||||||
|
type = types.lines;
|
||||||
default = ''
|
default = ''
|
||||||
(0, 0, 55)
|
(0, 0, 55)
|
||||||
(1, 48, 60)
|
(1, 48, 60)
|
||||||
|
@ -76,8 +109,12 @@ in {
|
||||||
(7, 60, 85)
|
(7, 60, 85)
|
||||||
(127, 80, 32767)
|
(127, 80, 32767)
|
||||||
'';
|
'';
|
||||||
description =''
|
description = ''
|
||||||
Sensor used by thinkfan
|
(LEVEL, LOW, HIGH)
|
||||||
|
LEVEL is the fan level to use (0-7 with thinkpad_acpi).
|
||||||
|
LOW is the temperature at which to step down to the previous level.
|
||||||
|
HIGH is the temperature at which to step up to the next level.
|
||||||
|
All numbers are integers.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue