Config to disable laptop's touchscreen capability?

tl;dr tips to disable hid-multitouch via nixos config?

On my millionth websearch I finally came across a working manual-solution, but still seeking help to declare via nixos config.

manual-fix: touch driver's API: the unbind file in /sys/bus/hid/drivers/hid-multitouch

Manual solution

So here’s the solution I found: I can disable the touchscreen via linux kernel driver hid-multitouch:

  1. list the currently bound multitouch devices:
$ ls -la /sys/bus/hid/drivers/hid-multitouch/

# you'll see symlinks here named after the ID of the device.
# eg: for me:
# - _one_ was my mouse-touchpad
# - the _other_ was my cracked touchscreen
  1. unbind one at a time until you identify which is the culprit:
$ echo SOME_DEVICE_ID_HERE |
  sudo tee /sys/bus/hid/drivers/hid-multitouch/unbind

# or re-enable via:
$ echo SOME_DEVICE_ID_HERE |
  sudo tee /sys/bus/hid/drivers/hid-multitouch/bind

So I’ve confirmed I have the correct device ID, and disabling it fixes my issues. Now to do this persistently across reboots…

TBD: how to do this via .nix configs…

Obviously I’d like to do that manual fix via nix config, eg: /etc/nixos/hardware-configuration.nix? But I’m not seeing anything obvious with my current web searches.