diff --git a/pkgs/applications/emulators/rpcs3/99-ds3-controllers.rules b/pkgs/applications/emulators/rpcs3/99-ds3-controllers.rules new file mode 100644 index 000000000000..a4f32124d970 --- /dev/null +++ b/pkgs/applications/emulators/rpcs3/99-ds3-controllers.rules @@ -0,0 +1,5 @@ +# DualShock 3 over USB +KERNEL=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", MODE="0666" + +# DualShock 3 over Bluetooth +KERNEL=="hidraw*", KERNELS=="*054C:0268*", MODE="0666" diff --git a/pkgs/applications/emulators/rpcs3/99-ds4-controllers.rules b/pkgs/applications/emulators/rpcs3/99-ds4-controllers.rules new file mode 100644 index 000000000000..6061debfbff8 --- /dev/null +++ b/pkgs/applications/emulators/rpcs3/99-ds4-controllers.rules @@ -0,0 +1,14 @@ +# DualShock 4 over USB +KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666" + +# DualShock 4 Wireless Adapter over USB +KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666" + +# DualShock 4 Slim over USB +KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666" + +# DualShock 4 over Bluetooth +KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666" + +# DualShock 4 Slim over Bluetooth +KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666" diff --git a/pkgs/applications/emulators/rpcs3/99-dualsense-controllers.rules b/pkgs/applications/emulators/rpcs3/99-dualsense-controllers.rules new file mode 100644 index 000000000000..fb3ed3eec3f5 --- /dev/null +++ b/pkgs/applications/emulators/rpcs3/99-dualsense-controllers.rules @@ -0,0 +1,5 @@ +# PS5 DualSense controller over USB hidraw +KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6", MODE="0660", TAG+="uaccess" + +# PS5 DualSense controller over bluetooth hidraw +KERNEL=="hidraw*", KERNELS=="*054C:0CE6*", MODE="0660", TAG+="uaccess" diff --git a/pkgs/applications/emulators/rpcs3/default.nix b/pkgs/applications/emulators/rpcs3/default.nix index 46311c3ed45b..3609b9492da4 100644 --- a/pkgs/applications/emulators/rpcs3/default.nix +++ b/pkgs/applications/emulators/rpcs3/default.nix @@ -70,6 +70,13 @@ gcc11Stdenv.mkDerivation { ++ lib.optional alsaSupport alsa-lib ++ lib.optional waylandSupport wayland; + postInstall = '' + # Taken from https://wiki.rpcs3.net/index.php?title=Help:Controller_Configuration + install -D ${./99-ds3-controllers.rules} $out/etc/udev/rules.d/99-ds3-controllers.rules + install -D ${./99-ds4-controllers.rules} $out/etc/udev/rules.d/99-ds4-controllers.rules + install -D ${./99-dualsense-controllers.rules} $out/etc/udev/rules.d/99-dualsense-controllers.rules + ''; + meta = with lib; { description = "PS3 emulator/debugger"; homepage = "https://rpcs3.net/";