From 4bded92554967c3475702d32abc260e37bc2a2d2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 21 Dec 2020 18:13:41 +0000 Subject: [PATCH] nixos/thermald: Allow switching package Sometimes newer versions than what nixpkgs provides is needed for certain hardware, especially for stable releases where I will backport this commit. --- nixos/modules/services/hardware/thermald.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/hardware/thermald.nix b/nixos/modules/services/hardware/thermald.nix index 6be255cebf1d..aa936ac09d1d 100644 --- a/nixos/modules/services/hardware/thermald.nix +++ b/nixos/modules/services/hardware/thermald.nix @@ -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}"} \