summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--modules/services/x11/hardware/synaptics.nix33
-rw-r--r--modules/services/x11/xserver.nix2
2 files changed, 13 insertions, 22 deletions
diff --git a/modules/services/x11/hardware/synaptics.nix b/modules/services/x11/hardware/synaptics.nix
index 5f832ab7d224..a8abe87ea2be 100644
--- a/modules/services/x11/hardware/synaptics.nix
+++ b/modules/services/x11/hardware/synaptics.nix
@@ -17,9 +17,13 @@ let cfg = config.services.xserver.synaptics; in
       };
 
       dev = mkOption {
-        default = "/dev/input/event0";
-	example = null;
-        description = "Event device for Synaptics touchpad, null to omit specification.";
+        default = null;
+	example = "/dev/input/event0";
+        description = 
+          ''
+            Path for touchpad device.  Set to null to apply to any
+            auto-detected touchpad.
+          '';
       };
 
       minSpeed = mkOption {
@@ -53,25 +57,17 @@ let cfg = config.services.xserver.synaptics; in
 
     services.xserver.config =
       ''
-        Section "InputDevice"
-          Identifier "Touchpad[0]"
+        # Automatically enable the synaptics driver for all touchpads.
+        Section "InputClass"
+          Identifier "touchpad catchall"
           Driver "synaptics"
-          ${if cfg.dev != null then ''Option "Device" "${cfg.dev}"'' else ""}
-          Option "Protocol" "PS/2"
-          Option "LeftEdge" "1700"
-          Option "RightEdge" "5300"
-          Option "TopEdge" "1700"
-          Option "BottomEdge" "4200"
-          Option "FingerLow" "25"
-          Option "FingerHigh" "30"
+          MatchIsTouchpad "on"
+          ${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''}
           Option "MaxTapTime" "180"
           Option "MaxTapMove" "220"
-          Option "VertScrollDelta" "100"
           Option "MinSpeed" "${cfg.minSpeed}"
           Option "MaxSpeed" "${cfg.maxSpeed}"
           Option "AccelFactor" "0.0010"
-          Option "SHMConfig" "on"
-          Option "Repeater" "/dev/input/mice"
           Option "TapButton1" "1"
           Option "TapButton2" "2"
           Option "TapButton3" "3"
@@ -81,11 +77,6 @@ let cfg = config.services.xserver.synaptics; in
         EndSection
       '';
 
-    services.xserver.serverLayoutSection =
-      ''
-        InputDevice "Touchpad[0]" "CorePointer"
-      '';
-
   };
 
 }
diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix
index 8276f1162230..900ed00f4b44 100644
--- a/modules/services/x11/xserver.nix
+++ b/modules/services/x11/xserver.nix
@@ -462,7 +462,7 @@ in
         EndSection
 
         Section "InputClass"
-          Identifier "Keyboards catch all"
+          Identifier "Keyboard catchall"
           MatchIsKeyboard "on"
           Option "XkbRules" "base"
           Option "XkbModel" "${cfg.xkbModel}"