summary refs log tree commit diff
path: root/nixos/modules/tasks/trackpoint.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/tasks/trackpoint.nix')
-rw-r--r--nixos/modules/tasks/trackpoint.nix24
1 files changed, 9 insertions, 15 deletions
diff --git a/nixos/modules/tasks/trackpoint.nix b/nixos/modules/tasks/trackpoint.nix
index 4be2c3eb4c47..d1c6f8ac1565 100644
--- a/nixos/modules/tasks/trackpoint.nix
+++ b/nixos/modules/tasks/trackpoint.nix
@@ -46,21 +46,15 @@ with lib;
 
   config = mkIf config.hardware.trackpoint.enable {
 
-    jobs.trackpoint =
-      { description = "Initialize trackpoint";
-
-        startOn = "started udev";
-
-        task = true;
-
-        script = ''
-          echo -n ${toString config.hardware.trackpoint.sensitivity} \
-            > /sys/devices/platform/i8042/serio1/sensitivity
-          echo -n ${toString config.hardware.trackpoint.speed} \
-            > /sys/devices/platform/i8042/serio1/speed
-        '';
-      };
-         
+    services.udev.extraRules =
+    ''
+      ACTION=="add|change", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/speed}="${toString config.hardware.trackpoint.speed}", ATTR{device/sensitivity}="${toString config.hardware.trackpoint.sensitivity}"
+    '';
+
+    system.activationScripts.trackpoint =
+      ''
+        ${config.systemd.package}/bin/udevadm trigger --attr-match=name="TPPS/2 IBM TrackPoint"
+      '';
   };
 
 }