summary refs log tree commit diff
path: root/modules/services
diff options
context:
space:
mode:
authorcillianderoiste <cillian.deroiste@gmail.com>2013-01-05 12:31:42 -0800
committercillianderoiste <cillian.deroiste@gmail.com>2013-01-05 12:31:42 -0800
commit0412d6413e897b6088df3a620cf60dcb8e647129 (patch)
tree3dc1f6bffc1b113d8a1d19a49a2452726d72f4e8 /modules/services
parenta3ee9aac982172966d8dae67ce9d248f0b5f2bf2 (diff)
parent462a9f9fb05e2cb15103127c81d8266b7efb1a18 (diff)
downloadnixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar.gz
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar.bz2
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar.lz
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar.xz
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.tar.zst
nixlib-0412d6413e897b6088df3a620cf60dcb8e647129.zip
Merge pull request #64 from oxij/master
Fix wacom and cherry-pick acpid fix by surr
Diffstat (limited to 'modules/services')
-rw-r--r--modules/services/hardware/acpid.nix4
-rw-r--r--modules/services/x11/hardware/wacom.nix54
2 files changed, 44 insertions, 14 deletions
diff --git a/modules/services/hardware/acpid.nix b/modules/services/hardware/acpid.nix
index 303db3816b5a..26c600092db3 100644
--- a/modules/services/hardware/acpid.nix
+++ b/modules/services/hardware/acpid.nix
@@ -8,11 +8,11 @@ let
     ''
       ensureDir $out
       ${
-        # Generate a .conf file for each event. (You can't have
+        # Generate a configuration file for each event. (You can't have
         # multiple events in one config file...)
         let f = event:
           ''
-            fn=$out/${event.name}.conf
+            fn=$out/${event.name}
             echo "event=${event.event}" > $fn
             echo "action=${pkgs.writeScript "${event.name}.sh" event.action}" >> $fn
           '';
diff --git a/modules/services/x11/hardware/wacom.nix b/modules/services/x11/hardware/wacom.nix
index 98717ce5a5bb..1ea928d9c76e 100644
--- a/modules/services/x11/hardware/wacom.nix
+++ b/modules/services/x11/hardware/wacom.nix
@@ -16,18 +16,41 @@ in
 
       enable = mkOption {
         default = false;
-        description = "Whether to enable the Wacom touchscreen/digitizer.";
+        description = "Whether to enable the Wacom touchscreen/digitizer/tablet.";
       };
 
       device = mkOption {
-        default = "/dev/ttyS0";
-        description = "Device to use.";
+        default = null;
+        example = "/dev/ttyS0";
+        description = "Device to use. Set to null for autodetect (think USB tablet).";
       };
 
       forceDeviceType = mkOption {
-        default = "ISDV4";
-        example = null;
-        description = "Some models (think touchscreen) require the device type to be specified.";
+        default = null;
+        example = "ISDV4";
+        description = "Some models (think touchscreen) require the device type to be specified. Set to null for autodetect (think USB tablet).";
+      };
+
+      stylusExtraConfig = mkOption {
+        default = "";
+        example = ''
+            Option "Button1" "2"
+          '';
+        description = "Lines to be added to Wacom_stylus InputDevice section.";
+      };
+
+      eraserExtraConfig = mkOption {
+        default = "";
+        example = ''
+            Option "Button2" "3"
+          '';
+        description = "Lines to be added to Wacom_eraser InputDevice section.";
+      };
+
+      cursorExtraConfig = mkOption {
+        default = "";
+        example = "";
+        description = "Lines to be added to Wacom_cursor InputDevice section.";
       };
 
     };
@@ -44,8 +67,8 @@ in
     services.xserver.serverLayoutSection =
       ''
         InputDevice "Wacom_stylus"
-        InputDevice "Wacom_cursor"
         InputDevice "Wacom_eraser"
+        InputDevice "Wacom_cursor"
       '';
 
     services.xserver.config =
@@ -53,33 +76,40 @@ in
         Section "InputDevice"
           Driver "wacom"
           Identifier "Wacom_stylus"
-          Option "Device" "${cfg.device}"
+          ${optionalString (cfg.device != null) ''
+            Option "Device" "${cfg.device}"
+          ''}
           Option "Type" "stylus"
           ${optionalString (cfg.forceDeviceType != null) ''
             Option "ForceDevice" "${cfg.forceDeviceType}"
           ''}
-          Option "Button2" "3"
+          ${cfg.stylusExtraConfig}
         EndSection
 
         Section "InputDevice"
           Driver "wacom"
           Identifier "Wacom_eraser"
-          Option "Device" "${cfg.device}"
+          ${optionalString (cfg.device != null) ''
+            Option "Device" "${cfg.device}"
+          ''}
           Option "Type" "eraser"
           ${optionalString (cfg.forceDeviceType != null) ''
             Option "ForceDevice" "${cfg.forceDeviceType}"
           ''}
-          Option "Button1" "2"
+          ${cfg.eraserExtraConfig}
         EndSection
 
         Section "InputDevice"
           Driver "wacom"
           Identifier "Wacom_cursor"
-          Option "Device" "${cfg.device}"
+          ${optionalString (cfg.device != null) ''
+            Option "Device" "${cfg.device}"
+          ''}
           Option "Type" "cursor"
           ${optionalString (cfg.forceDeviceType != null) ''
             Option "ForceDevice" "${cfg.forceDeviceType}"
           ''}
+          ${cfg.cursorExtraConfig}
         EndSection
       '';