summary refs log tree commit diff
path: root/nixos/modules/services/misc/mbpfan.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-27 18:40:33 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-27 18:40:41 +0000
commit030c5028b07afcedce7c5956015c629486cc79d9 (patch)
tree4c3cb9c6cff0e30919a97fc0c1d3203446696f4e /nixos/modules/services/misc/mbpfan.nix
parent4b852f7ef3cb92277f212ba7dc168da1073e65cc (diff)
parent04c0744afbab2369baf4f134c544db3f24164d80 (diff)
downloadnixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.gz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.bz2
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.lz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.xz
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.tar.zst
nixpkgs-030c5028b07afcedce7c5956015c629486cc79d9.zip
Rebase onto c1a53897ad4290a1cbfa02fbe6f3869577b93744
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'nixos/modules/services/misc/mbpfan.nix')
-rw-r--r--nixos/modules/services/misc/mbpfan.nix19
1 files changed, 8 insertions, 11 deletions
diff --git a/nixos/modules/services/misc/mbpfan.nix b/nixos/modules/services/misc/mbpfan.nix
index e75c3525414..8f64fb2d9c5 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}";