summary refs log tree commit diff
path: root/nixos/modules/services/hardware
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-21 18:13:41 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-21 18:14:53 +0000
commit4bded92554967c3475702d32abc260e37bc2a2d2 (patch)
treeb9b0f0eaa08df784fd0cff9514851eb810227a43 /nixos/modules/services/hardware
parente49c1a0027eb1d41cbc74f15f5a3295c62d4d040 (diff)
downloadnixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar.gz
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar.bz2
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar.lz
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar.xz
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.tar.zst
nixpkgs-4bded92554967c3475702d32abc260e37bc2a2d2.zip
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.
Diffstat (limited to 'nixos/modules/services/hardware')
-rw-r--r--nixos/modules/services/hardware/thermald.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/services/hardware/thermald.nix b/nixos/modules/services/hardware/thermald.nix
index 6be255cebf1..aa936ac09d1 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}"} \