nixos/thinkfan: use non-deprecated keywords in config file. #40768
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Currently, the thinkfan config written by nix is not being correctly read as it uses the deprecated keyword
sensor
(see https://man.cx/thinkfan(1)). For instance, if I add the following expression to my configuration.nix file:thinkfan will print error messages in
journalctl
:What's more, thinkfan may read temperatures from multiple sensors, and offers an option to specify the fan.
Things done
The change is breaking. However since the previous way of doing it does not really work in practice I think it is the way to go.
I modified the configuration options of the thinkfan service to allow multiple thermal sensors (in
services.thinkfan.sensors
) and removed the hard-codedsensor
keyword.To note:
in the description of the keyword
sensor
, I noted that thinkfan may monitor hard drives temperatures if it had been compiled with theUSE_ATASMART
file, but I didn't enable this flag because thinkfan author's notes : "Enable libatasmart to read temperatures directly from hard disks. Use this only when you really need it, since libatasmart is unreasonably CPU-intensive."I did not test these changes, I do not know how to test services.
Maybe it would be better to leave the defaults empty: an incorrect configuration for a given system may lead to overheating (and permanent damage). Nevertheless, I left it the way it was, I expect thinkfan users to be quite knowledgeable, and defaults may therefore serve as examples.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)