I don't know how well this applies to nixos specifically, but another approach I've used successfully is to set the appropriate settings in xinput. You wont have to remove the synaptics driver either.
First, you'll need to find the name of the input method that corresponds to your touchpad by running
xinput --list
You'll get list of all your input devices. Look for the device that corresponds to your touchpad. In my case, the name for my touchpad was "SynPS/2 Synaptics TouchPad
".
The second step is to get a list of all device properties that can be set through xinput
:
xinput --list-props 'TRACKPAD NAME'
If the property name 'libinput Natural Scrolling Enabled', then you're in luck! Just set the property by running:
xinput set-prop 'TRACKPAD NAME' 'libinput Natural Scrolling Enabled' 1
and you're set.
As a bonus, it seems that libinput(1)
is a drop-in replacement for xinput that works with Wayland, so this method should work for wayland users as well.
Finally, you can also control other properties of the trackpad this way. I've used it to disable tap clicks.