{ config, lib, pkgs, ... }: with lib; mkIf (elem "udev" config.machine.services) { services.udev.extraRules = '' # Valve USB devices SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", TAG+="uaccess", TAG+="udev-acl" # Steam Controller udev write access KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", TAG+="udev-acl" # Valve HID devices over USB hidraw KERNEL=="hidraw*", ATTRS{idVendor}=="28de", TAG+="uaccess", TAG+="udev-acl" # Valve HID devices over bluetooth hidraw KERNEL=="hidraw*", KERNELS=="*28DE:*", TAG+="uaccess", TAG+="udev-acl" # DualShock 4 over USB hidraw KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", TAG+="uaccess", TAG+="udev-acl" # DualShock 4 wireless adapter over USB hidraw KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", TAG+="uaccess", TAG+="udev-acl" # DualShock 4 Slim over USB hidraw KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", TAG+="uaccess", TAG+="udev-acl" # DualShock 4 over bluetooth hidraw KERNEL=="hidraw*", KERNELS=="*054C:05C4*", TAG+="uaccess", TAG+="udev-acl" # DualShock 4 Slim over bluetooth hidraw KERNEL=="hidraw*", KERNELS=="*054C:09CC*", TAG+="uaccess", TAG+="udev-acl" ''; }