lol

nixos/mbpfan: adjust defaults

bb2020 5caa8228 20dd5a0d

+10 -11
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 300 300 301 301 - New `boot.bcache.enable` (default enabled) allows completely removing `bcache` mount support. 302 302 303 + - The module `services.mbpfan` now has the option `aggressive` enabled by default for better heat moderation. You can disable it for upstream defaults. 304 + 303 305 - `security.sudo` now provides two extra options, that do not change the 304 306 module's default behaviour: 305 307 - `defaultOptions` controls the options used for the default rules;
+8 -11
nixos/modules/services/misc/mbpfan.nix
··· 26 26 27 27 aggressive = mkOption { 28 28 type = types.bool; 29 - default = false; 29 + default = true; 30 30 description = lib.mdDoc "If true, favors higher default fan speeds."; 31 31 }; 32 32 ··· 38 38 39 39 options.general.low_temp = mkOption { 40 40 type = types.int; 41 - default = 63; 41 + default = (if cfg.aggressive then 55 else 63); 42 + defaultText = literalExpression "55"; 42 43 description = lib.mdDoc "If temperature is below this, fans will run at minimum speed."; 43 44 }; 44 45 options.general.high_temp = mkOption { 45 46 type = types.int; 46 - default = 66; 47 + default = (if cfg.aggressive then 58 else 66); 48 + defaultText = literalExpression "58"; 47 49 description = lib.mdDoc "If temperature is above this, fan speed will gradually increase."; 48 50 }; 49 51 options.general.max_temp = mkOption { 50 52 type = types.int; 51 - default = 86; 53 + default = (if cfg.aggressive then 78 else 86); 54 + defaultText = literalExpression "78"; 52 55 description = lib.mdDoc "If temperature is above this, fans will run at maximum speed."; 53 56 }; 54 57 options.general.polling_interval = mkOption { ··· 70 73 ]; 71 74 72 75 config = mkIf cfg.enable { 73 - services.mbpfan.settings = mkIf cfg.aggressive { 74 - general.min_fan1_speed = mkDefault 2000; 75 - general.low_temp = mkDefault 55; 76 - general.high_temp = mkDefault 58; 77 - general.max_temp = mkDefault 70; 78 - }; 79 - 80 76 boot.kernelModules = [ "coretemp" "applesmc" ]; 81 77 environment.systemPackages = [ cfg.package ]; 82 78 environment.etc."mbpfan.conf".source = settingsFile; ··· 86 82 wantedBy = [ "sysinit.target" ]; 87 83 after = [ "syslog.target" "sysinit.target" ]; 88 84 restartTriggers = [ config.environment.etc."mbpfan.conf".source ]; 85 + 89 86 serviceConfig = { 90 87 Type = "simple"; 91 88 ExecStart = "${cfg.package}/bin/mbpfan -f${verbose}";