[Unit] Description=Headless Sway compositor for Sunshine wlr capture # Don't auto-restart on `systemctl --user stop` — but bring sway back if it # actually crashes mid-stream. After=graphical-session-pre.target PartOf=graphical-session.target [Service] Type=simple # Tell wlroots to use the headless backend (no DRM master needed) and skip # libinput device probing — there are no input devices on a real headless box. # # GLES2 renderer: the Vulkan backend strictly requires # VK_EXT_external_memory_dma_buf, which the proprietary NVIDIA driver # doesn't expose on every build (esp. data-center / -server branches). GLES2 # is universally available and Sunshine's capture path uses its own dma-buf # flow, so we don't lose hardware acceleration. Environment=WLR_BACKENDS=headless Environment=WLR_LIBINPUT_NO_DEVICES=1 # Pixman (software) renderer. The GLES2 path needs a GBM-allocated framebuffer, # which fails on the proprietary NVIDIA driver: its GBM bridge doesn't permit # unprivileged CREATE_DUMB even on render nodes (Mesa drivers do). The trade- # off: Sunshine's wlr-screencopy then takes the shm path and uses libx264 # software encoding. For NVENC on NVIDIA cloud GPUs, sunshine should be # pointed at a virtual KMS connector (vkms or Xorg+Dummy) instead of wlroots. Environment=WLR_RENDERER=pixman Environment=XDG_SESSION_TYPE=wayland ExecStart=/usr/bin/sway --config %h/.config/sway/config-headless --unsupported-gpu Restart=on-failure RestartSec=2s TimeoutStopSec=5s [Install] WantedBy=default.target