From 2624e68a7ca17975d027833906b25fb10bf36e26 Mon Sep 17 00:00:00 2001 From: 0xWheatyz Date: Sun, 24 May 2026 19:49:20 -0400 Subject: [PATCH] feat(nixos): auto-start UxPlay as a user systemd service Run UxPlay under graphical-session.target so the AirPlay receiver is discoverable as soon as the GNOME session is up, instead of requiring a manual `uxplay` invocation per login. Constraint: UxPlay needs the active graphical session for display + PipeWire Rejected: system-level service | runs before user session, no display/audio access Rejected: GNOME autostart .desktop entry | no Restart-on-failure semantics Confidence: high Scope-risk: narrow Directive: keep wantedBy on graphical-session.target (not default.target) so the unit only runs when a desktop session is live Not-tested: behavior on fast user switching between two desktop sessions --- configuration.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configuration.nix b/configuration.nix index 99c6eb7..387328c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -293,6 +293,20 @@ }; }; + # Auto-start UxPlay with the graphical session so iOS Screen Mirroring + # can find this host without manually launching it. + systemd.user.services.uxplay = { + description = "UxPlay AirPlay Mirror Receiver"; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" "pipewire.service" ]; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.uxplay}/bin/uxplay"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + security.pam.services = { login.u2fAuth = true; sudo.u2fAuth = true;