So I have a FiiO FA15, and I would like to be able to program it from a NixOS box.
Bus 003 Device 016: ID 2972:0104 FiiO Electronics Technology FIIO KA15
I have some custom rules on my Debian box, and it works perfectly. But on NixOS, you cannot just drop a ruleset into /etc/udev/rules.d and I can understand the rational for that.
HIDEvent[15:09:48] Failed to open '/dev/hidraw3': FILE_ERROR_ACCESS_DENIED
HIDEvent[15:09:48] Access denied opening device read-write, trying read-only.
HIDUser[15:09:40] HID device added: vendorId=10610, productId=260, name='FIIO KA15', serial='', deviceIds=['/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/0003:2972:0104.0033/hidraw/hidraw3'], reportDescriptor='BQwJAaEBhQMVACUDdQGVAgnpCeqBApUECc0Jzwm1CbaBApUCgQEGAf+FS3UIlT8JAYEDlT8JApEChQd1CJU/CQOBA5U/CQSRAsA='
USBUser[15:09:40] USB device added: path=/dev/bus/usb/003/013 vendor=10610 "FIIO", product=260 "FIIO KA15", serial="", guid=e9ddc125-8df6-459a-ba6c-145b320a26aaa
# hid_listen
KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
I understand that the plugdev group is considered deprecated on NixOS, and there is maybe a trezord group instead but that does not exist on my system. I have also seen ${cfg.group} or simply dropping GROUP altogether.
There is services.udev.extraRules which will apparently drop it into 99-local.rules, but I am not sure that is ideal.
There is services.udev.packages which lets you specify the contents and target of your rule.
But I would like to see a more modular approach and ask to see what if any the consensus is.
There is a flake approach and a module approach, but it seems like the flake approach would be better.
I will for now probably just stick in a services.udev.packages to try to get it working. But what would be nice would be a guide to doing this in a nice way that is scalable. I had to do this with a keychrome on Debian and Void and it was fairly simple. It ought to be just as simple, well as simple as possible, for a NixOS newbie to do it on NixOS. I think NixOS would benefit from more easy to follow guides and documentation. Haskell often suffers from the same issue, just throw the type sigs out there and declare that is all you need to understand.
Thank you for your thoughts
