Files
nixos-configs/roles/desktop/gaming.nix
T
johno 58dbbb36ec feat(gaming): add udev symlinks for PDP RiffMaster guitars by serial
Create /dev/input/yarg-ladybug and /dev/input/yarg-fly symlinks based on each guitar's unique USB serial number, so YARG can distinguish the two identical controllers regardless of connection order.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-11 20:07:15 -07:00

62 lines
1.9 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.roles.desktop;
in
{
config = mkMerge [
(mkIf (cfg.enable && cfg.gaming.enable) {
environment.systemPackages = with pkgs; [
lutris
moonlight
# Emulators
dolphin-emu
# Re-enabled in 25.11 after binary build was fixed
dolphin-emu-primehack
# Experimenting with just using the steam version + downloading
# indiviudal cores
#retroarch-full
ryubing
yarg
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
# Xbox wireless protocol support (PDP RiffMaster Xbox, Xbox controllers, etc.)
hardware.xone.enable = true;
# YARG (rhythm game) needs udev rules for HID controller access.
# Without these, instruments (Wii, PS3, etc.) can't be read without
# sudo, and Steam's input layer must be used as a workaround (which
# causes connectivity conflicts).
# Note: Xbox peripherals (PDP RiffMaster Xbox) use xone instead of hidraw.
services.udev.extraRules = ''
# Allow user access to hidraw devices (Wii/PS3/PS4 instruments, etc.)
KERNEL=="hidraw*", TAG+="uaccess"
# Xbox 360 Wireless Adapter
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="0291", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02a9", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="0719", MODE="0666"
# PDP RiffMaster Xbox - named symlinks by serial number
# Ladybug
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{serial}=="0000765A5937FF9B", SYMLINK+="input/yarg-ladybug"
# Fly
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{serial}=="0000C8733EB92FC5", SYMLINK+="input/yarg-fly"
'';
})
];
}