10 hardware.trackpoint = {
16 Enable sensitivity and speed configuration for trackpoints.
20 sensitivity = mkOption {
25 Configure the trackpoint sensitivity. By default, the kernel
35 Configure the trackpoint speed. By default, the kernel
40 emulateWheel = mkOption {
44 Enable scrolling while holding the middle mouse button.
48 fakeButtons = mkOption {
52 Switch to "bare" PS/2 mouse support in case Trackpoint buttons are not recognized
53 properly. This can happen for example on models like the L430, T450, T450s, on
54 which the Trackpoint buttons are actually a part of the Synaptics touchpad.
59 default = "TPPS/2 IBM TrackPoint";
62 The device name of the trackpoint. You can check with xinput.
63 Some newer devices (example x1c6) use "TPPS/2 Elan TrackPoint".
75 let cfg = config.hardware.trackpoint; in
78 services.udev.extraRules =
80 ACTION=="add|change", SUBSYSTEM=="input", ATTR{name}=="${cfg.device}", ATTR{device/speed}="${toString cfg.speed}", ATTR{device/sensitivity}="${toString cfg.sensitivity}"
83 systemd.services.trackpoint = {
84 wantedBy = [ "sysinit.target" ] ;
85 before = [ "sysinit.target" "shutdown.target" ];
86 conflicts = [ "shutdown.target" ];
87 unitConfig.DefaultDependencies = false;
88 serviceConfig.Type = "oneshot";
89 serviceConfig.RemainAfterExit = true;
90 serviceConfig.ExecStart = ''
91 ${config.systemd.package}/bin/udevadm trigger --attr-match=name="${cfg.device}"
96 (mkIf (cfg.emulateWheel) {
97 services.xserver.inputClassSections = [
99 Identifier "Trackpoint Wheel Emulation"
100 MatchProduct "${if cfg.fakeButtons then "PS/2 Generic Mouse" else "ETPS/2 Elantech TrackPoint|Elantech PS/2 TrackPoint|TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint|${cfg.device}"}"
101 MatchDevicePath "/dev/input/event*"
102 Option "EmulateWheel" "true"
103 Option "EmulateWheelButton" "2"
104 Option "Emulate3Buttons" "false"
105 Option "XAxisMapping" "6 7"
106 Option "YAxisMapping" "4 5"
111 (mkIf cfg.fakeButtons {
112 boot.extraModprobeConfig = "options psmouse proto=bare";