3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #107338 from Ericson2314/thermald-allow-custom-package

nixos/thermald: Allow switching package
This commit is contained in:
John Ericson 2020-12-21 15:23:53 -05:00 committed by GitHub
commit 9a6d2ba1c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,19 +23,26 @@ in {
default = null;
description = "the thermald manual configuration file.";
};
package = mkOption {
type = types.package;
default = pkgs.thermald;
defaultText = "pkgs.thermald";
description = "Which thermald package to use.";
};
};
};
###### implementation
config = mkIf cfg.enable {
services.dbus.packages = [ pkgs.thermald ];
services.dbus.packages = [ cfg.package ];
systemd.services.thermald = {
description = "Thermal Daemon Service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.thermald}/sbin/thermald \
${cfg.package}/sbin/thermald \
--no-daemon \
${optionalString cfg.debug "--loglevel=debug"} \
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \