diff options
author | Charles Strahan <charles.c.strahan@gmail.com> | 2015-05-01 17:11:00 -0400 |
---|---|---|
committer | Charles Strahan <charles.c.strahan@gmail.com> | 2015-05-01 17:11:55 -0400 |
commit | ba50d4840063bcc8cd662c48262c90102ec7132a (patch) | |
tree | 2e38a8e7b681e0c5f1ca4b0c0e164ea513a85278 /nixos | |
parent | 4c01e6d91993b6de128795f4fbdd25f6227fb870 (diff) | |
download | nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar.gz nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar.bz2 nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar.lz nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar.xz nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.tar.zst nixlib-ba50d4840063bcc8cd662c48262c90102ec7132a.zip |
mbpfan: service improvements
* add verbosity setting * don't set mbpfan as a setuid program
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/mbpfan.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/nixos/modules/services/misc/mbpfan.nix b/nixos/modules/services/misc/mbpfan.nix index 2767520d78f7..3fb5f684b761 100644 --- a/nixos/modules/services/misc/mbpfan.nix +++ b/nixos/modules/services/misc/mbpfan.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.services.mbpfan; + verbose = if cfg.verbose then "v" else ""; in { options.services.mbpfan = { @@ -69,13 +70,19 @@ in { The polling interval. ''; }; + + verbose = mkOption { + type = types.bool; + default = false; + description = '' + If true, sets the log level to verbose. + ''; + }; }; config = mkIf cfg.enable { boot.kernelModules = [ "coretemp" "applesmc" ]; - security.setuidPrograms = [ "mbpfan" ]; - environment = { etc."mbpfan.conf".text = '' [general] @@ -96,7 +103,7 @@ in { restartTriggers = [ config.environment.etc."mbpfan.conf".source ]; serviceConfig = { Type = "simple"; - ExecStart = "${cfg.package}/bin/mbpfan -fv"; + ExecStart = "${cfg.package}/bin/mbpfan -f${verbose}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; PIDFile = "/var/run/mbpfan.pid"; Restart = "always"; |