diff options
author | Aaron Andersen <aaron@fosslib.net> | 2023-09-23 09:41:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 09:41:11 -0400 |
commit | 2af64a3d1d65c28d8760c0b2e46ec3324b14344c (patch) | |
tree | 4181e9fa75b7119dfc8e88627c10a5d7ae940e9a /nixos | |
parent | 34a11c3f4adc6e4621a0f65ceea7aa5c7c74ec5a (diff) | |
parent | 5caa82281ee9f7a6d0f79aa3e2170c6fc503b77c (diff) | |
download | nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar.gz nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar.bz2 nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar.lz nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar.xz nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.tar.zst nixlib-2af64a3d1d65c28d8760c0b2e46ec3324b14344c.zip |
Merge pull request #246173 from bb2020/mbpfan
nixos/mbpfan: adjust defaults
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2311.section.md | 2 | ||||
-rw-r--r-- | nixos/modules/services/misc/mbpfan.nix | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 517de615d648..ed1e4b3c8ab4 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -304,6 +304,8 @@ The module update takes care of the new config syntax and the data itself (user - New `boot.bcache.enable` (default enabled) allows completely removing `bcache` mount support. +- The module `services.mbpfan` now has the option `aggressive` enabled by default for better heat moderation. You can disable it for upstream defaults. + - `security.sudo` now provides two extra options, that do not change the module's default behaviour: - `defaultOptions` controls the options used for the default rules; diff --git a/nixos/modules/services/misc/mbpfan.nix b/nixos/modules/services/misc/mbpfan.nix index e75c35254143..8f64fb2d9c52 100644 --- a/nixos/modules/services/misc/mbpfan.nix +++ b/nixos/modules/services/misc/mbpfan.nix @@ -26,7 +26,7 @@ in { aggressive = mkOption { type = types.bool; - default = false; + default = true; description = lib.mdDoc "If true, favors higher default fan speeds."; }; @@ -38,17 +38,20 @@ in { options.general.low_temp = mkOption { type = types.int; - default = 63; + default = (if cfg.aggressive then 55 else 63); + defaultText = literalExpression "55"; description = lib.mdDoc "If temperature is below this, fans will run at minimum speed."; }; options.general.high_temp = mkOption { type = types.int; - default = 66; + default = (if cfg.aggressive then 58 else 66); + defaultText = literalExpression "58"; description = lib.mdDoc "If temperature is above this, fan speed will gradually increase."; }; options.general.max_temp = mkOption { type = types.int; - default = 86; + default = (if cfg.aggressive then 78 else 86); + defaultText = literalExpression "78"; description = lib.mdDoc "If temperature is above this, fans will run at maximum speed."; }; options.general.polling_interval = mkOption { @@ -70,13 +73,6 @@ in { ]; config = mkIf cfg.enable { - services.mbpfan.settings = mkIf cfg.aggressive { - general.min_fan1_speed = mkDefault 2000; - general.low_temp = mkDefault 55; - general.high_temp = mkDefault 58; - general.max_temp = mkDefault 70; - }; - boot.kernelModules = [ "coretemp" "applesmc" ]; environment.systemPackages = [ cfg.package ]; environment.etc."mbpfan.conf".source = settingsFile; @@ -86,6 +82,7 @@ in { wantedBy = [ "sysinit.target" ]; after = [ "syslog.target" "sysinit.target" ]; restartTriggers = [ config.environment.etc."mbpfan.conf".source ]; + serviceConfig = { Type = "simple"; ExecStart = "${cfg.package}/bin/mbpfan -f${verbose}"; |