Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lm_sensors: add fancontrol module #70933

Closed
wants to merge 1 commit into from
Closed

Conversation

zopieux
Copy link
Contributor

@zopieux zopieux commented Oct 10, 2019

Motivation for this change

lm_sensors package provides a fancontrol script that regularly checks temperature sensors and adapts fan speeds according to a config file. This PR adds a fancontrol module to enable that feature.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions (Arch)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@delroth delroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zopieux
Copy link
Contributor Author

zopieux commented Oct 10, 2019

Hah, indeed, fun timing. Do you still want to cherry-pick the test or is this too trivial?

fancontrol is a small script that checks temperature sensors and adapts
fan speeds accordingly. It reads a text config file that can be
auto-generated by running the pwmconfig wizard on the live system.
@evils
Copy link
Member

evils commented Oct 15, 2019

aside from mine being in config.hardware and linking to pwmconfig's man page (as suggested in #69398), explicitly mentioning the need for config in the mkEnableOption (the process of setting up fancontrol is too much yak shaving to not have that in there IMO) and being in services/hardware,
yours looks more polished (i was considering writing a test for this to learn about them xD)
i'm also not sure the default value for config couldn't be buildins.readFile /etc/fancontrol since that's where pwmconfig defaults to... (though i agree it shouldn't do that in nixos)

evils added a commit to evils/nixpkgs that referenced this pull request Oct 16, 2019
@evils
Copy link
Member

evils commented Oct 16, 2019

i merged our work here.

defaulting to null will result in an explicit failure if no config is given
and if the config is empty, starting the service will fail with:
"Some mandatory settings missing, please check your config file!"

enable will now show as "whether to enable software fan control"
systemd will now say "Started software fan control."

i'm not sure about the after = ["lm_sensors.service" ]; line, there is no such module
i'd also love a way to make the man pages available to the user since we're referring to them...

@zopieux
Copy link
Contributor Author

zopieux commented Oct 20, 2019

@evils-devils Thanks for merging in my work! Do you intend to submit the updated version soonish, so I can close that PR?

@evils
Copy link
Member

evils commented Oct 20, 2019

@zopieux i'll do so if you want that
though i was thinking you could merge my changes to your branch if you like them

@evils evils mentioned this pull request Oct 27, 2019
10 tasks
@zopieux
Copy link
Contributor Author

zopieux commented Oct 27, 2019

Thanks!

@zopieux zopieux closed this Oct 27, 2019
markuskowa pushed a commit that referenced this pull request Oct 29, 2019
* lm_sensors: add fancontrol module + nixos test

fancontrol is a small script that checks temperature sensors and adapts
fan speeds accordingly. It reads a text config file that can be
auto-generated by running the pwmconfig wizard on the live system.
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Jan 19, 2020
* lm_sensors: add fancontrol module + nixos test

fancontrol is a small script that checks temperature sensors and adapts
fan speeds accordingly. It reads a text config file that can be
auto-generated by running the pwmconfig wizard on the live system.

(cherry picked from commit 5a78ce3)
@zopieux zopieux deleted the local-zopieux branch October 4, 2020 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants