Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/thermald: add manual config generation #44923

Merged
merged 1 commit into from
Aug 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions nixos/modules/services/hardware/thermald.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@ let
cfg = config.services.thermald;
in {
###### interface
options = {
services.thermald = {
options = {
services.thermald = {
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.";
};
};
};

###### implementation
config = mkIf cfg.enable {
Expand All @@ -24,7 +38,15 @@ in {
systemd.services.thermald = {
description = "Thermal Daemon Service";
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
'';
};
};
};
}