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
This commit is contained in:
2026-05-24 19:49:20 -04:00
parent 4335687f48
commit 2624e68a7c
+14
View File
@@ -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 = { security.pam.services = {
login.u2fAuth = true; login.u2fAuth = true;
sudo.u2fAuth = true; sudo.u2fAuth = true;