Skip to content

Commit

Permalink
nixos/thermald: Allow switching package
Browse files Browse the repository at this point in the history
Sometimes newer versions than what nixpkgs provides is needed for
certain hardware, especially for stable releases where I will backport
this commit.
  • Loading branch information
Ericson2314 committed Dec 21, 2020
1 parent e49c1a0 commit 4bded92
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nixos/modules/services/hardware/thermald.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"} \
Expand Down

0 comments on commit 4bded92

Please sign in to comment.