summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2021-01-01 18:14:06 -0300
committerThiago Kenji Okada <thiagokokada@gmail.com>2021-01-02 14:09:31 -0300
commita2391053b6cceb1933b99f656f8b3a39b8df411c (patch)
tree1987e983133ef4abb8ceadefad25f7cd0d49433d /nixos/modules/hardware
parent0a1493646698f7176469d06dbeedd45632f15059 (diff)
downloadnixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar.gz
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar.bz2
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar.lz
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar.xz
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.tar.zst
nixpkgs-a2391053b6cceb1933b99f656f8b3a39b8df411c.zip
nixos/opentabletdriver: add package option
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/opentabletdriver.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/nixos/modules/hardware/opentabletdriver.nix b/nixos/modules/hardware/opentabletdriver.nix
index b759bcf034e..0f34d903f68 100644
--- a/nixos/modules/hardware/opentabletdriver.nix
+++ b/nixos/modules/hardware/opentabletdriver.nix
@@ -24,6 +24,15 @@ in
         '';
       };
 
+      package = mkOption {
+        type = types.package;
+        default = pkgs.opentabletdriver;
+        defaultText = "pkgs.opentabletdriver";
+        description = ''
+          OpenTabletDriver derivation to use.
+        '';
+      };
+
       daemon = {
         enable = mkOption {
           default = true;
@@ -37,9 +46,9 @@ in
   };
 
   config = mkIf cfg.enable {
-    environment.systemPackages = with pkgs; [ opentabletdriver ];
+    environment.systemPackages = [ cfg.package ];
 
-    services.udev.packages = with pkgs; [ opentabletdriver ];
+    services.udev.packages = [ cfg.package ];
 
     boot.blacklistedKernelModules = cfg.blacklistedKernelModules;
 
@@ -50,7 +59,7 @@ in
 
       serviceConfig = {
         Type = "simple";
-        ExecStart = "${opentabletdriver}/bin/otd-daemon -c ${opentabletdriver}/lib/OpenTabletDriver/Configurations";
+        ExecStart = "${cfg.package}/bin/otd-daemon -c ${cfg.package}/lib/OpenTabletDriver/Configurations";
         Restart = "on-failure";
       };
     };