From c7eb5796eacb6eb73fee68eb0744687bd4a2c2cb Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Tue, 18 Aug 2026 15:43:55 +0100 Subject: [PATCH] fix: grant sunshine access to /dev/uinput hardware.uinput, enabled by services.sunshine, sets /dev/uinput to root:uinput 0660 and adds no members to the group. Sunshine runs as a user service, so it failed to create the virtual mouse, keyboard and gamepads and the stream carried no input. Co-Authored-By: Claude Opus 5 (1M context) --- hosts/common/features/gaming/sunshine.nix | 5 +++++ hosts/common/features/remote-desktop.nix | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/hosts/common/features/gaming/sunshine.nix b/hosts/common/features/gaming/sunshine.nix index a4dc0b0..6bac69e 100644 --- a/hosts/common/features/gaming/sunshine.nix +++ b/hosts/common/features/gaming/sunshine.nix @@ -47,6 +47,11 @@ # the module's own systemd.user.services.sunshine definition. systemd.user.services.sunshine.environment.LD_LIBRARY_PATH = "/run/opengl-driver/lib"; + # hardware.uinput (pulled in by services.sunshine) makes /dev/uinput + # root:uinput 0660 and adds nobody to the group, so sunshine's virtual mouse + # and keyboard die with "Permission denied" and the stream takes no input. + users.groups.uinput.members = [ "naps62" ]; + # DualSense/DualShock emulation. Sunshine presents a *real* PS5 HID (touchpad, # motion, LEDs, rumble) via /dev/uhid, not plain uinput — a uinput pad can't # carry those features. The kernel uhid node is root-only (0600) with no udev diff --git a/hosts/common/features/remote-desktop.nix b/hosts/common/features/remote-desktop.nix index cd84b37..d6793ed 100644 --- a/hosts/common/features/remote-desktop.nix +++ b/hosts/common/features/remote-desktop.nix @@ -11,6 +11,11 @@ _: # moonlight shows a black, artefacted picture rather than any error. systemd.user.services.sunshine.serviceConfig.LimitNOFILE = 65536; + # hardware.uinput (pulled in by services.sunshine) makes /dev/uinput + # root:uinput 0660 and adds nobody to the group, so sunshine's virtual mouse + # and keyboard die with "Permission denied" and the stream takes no input. + users.groups.uinput.members = [ "naps62" ]; + services.sunshine = { enable = true; autoStart = true;