nixpkgs/nixos/modules/services/hardware/thermald.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2014-08-14 02:17:55 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.thermald;
in {
###### interface
options = {
services.thermald = {
2014-08-14 02:17:55 +02:00
enable = mkOption {
default = false;
description = ''
Whether to enable thermald, the temperature management daemon.
'';
};
debug = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable debug logging.
'';
};
configFile = mkOption {
type = types.nullOr types.path;
default = null;
description = "the thermald manual configuration file.";
};
};
};
2014-08-14 02:17:55 +02:00
###### implementation
config = mkIf cfg.enable {
services.dbus.packages = [ pkgs.thermald ];
2014-08-14 02:17:55 +02:00
systemd.services.thermald = {
description = "Thermal Daemon Service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.thermald}/sbin/thermald \
--no-daemon \
${optionalString cfg.debug "--loglevel=debug"} \
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
--dbus-enable
'';
};
2014-08-14 02:17:55 +02:00
};
};
}