at 18.09-beta 1.2 kB view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 cfg = config.services.thermald; 7in { 8 ###### interface 9 options = { 10 services.thermald = { 11 enable = mkOption { 12 default = false; 13 description = '' 14 Whether to enable thermald, the temperature management daemon. 15 ''; 16 }; 17 18 debug = mkOption { 19 type = types.bool; 20 default = false; 21 description = '' 22 Whether to enable debug logging. 23 ''; 24 }; 25 26 configFile = mkOption { 27 type = types.nullOr types.path; 28 default = null; 29 description = "the thermald manual configuration file."; 30 }; 31 }; 32 }; 33 34 ###### implementation 35 config = mkIf cfg.enable { 36 services.dbus.packages = [ pkgs.thermald ]; 37 38 systemd.services.thermald = { 39 description = "Thermal Daemon Service"; 40 wantedBy = [ "multi-user.target" ]; 41 serviceConfig = { 42 ExecStart = '' 43 ${pkgs.thermald}/sbin/thermald \ 44 --no-daemon \ 45 ${optionalString cfg.debug "--loglevel=debug"} \ 46 ${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \ 47 --dbus-enable 48 ''; 49 }; 50 }; 51 }; 52}