nixos/thermald: add manual config file
thermald has two modes: zero-config and manual. Sometimes it is useful to manually configure thermald to achieve better thermal results or to give thermald a hand when detecting possible cooling options.
This commit is contained in:
parent
dc1b036c96
commit
64223a2c1b
|
@ -6,16 +6,30 @@ let
|
||||||
cfg = config.services.thermald;
|
cfg = config.services.thermald;
|
||||||
in {
|
in {
|
||||||
###### interface
|
###### interface
|
||||||
options = {
|
options = {
|
||||||
services.thermald = {
|
services.thermald = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable thermald, the temperature management daemon.
|
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.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -24,7 +38,15 @@ in {
|
||||||
systemd.services.thermald = {
|
systemd.services.thermald = {
|
||||||
description = "Thermal Daemon Service";
|
description = "Thermal Daemon Service";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
script = "exec ${pkgs.thermald}/sbin/thermald --no-daemon --dbus-enable";
|
serviceConfig = {
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.thermald}/sbin/thermald \
|
||||||
|
--no-daemon \
|
||||||
|
${optionalString cfg.debug "--loglevel=debug"} \
|
||||||
|
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
|
||||||
|
--dbus-enable
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue