[PATCH 05/13] img/app: pipewire: move sockets out of XDG_RUNTIME_DIR

Alyssa Ross
2025-11-26T21:34:59Z

This will make it easier to run PipeWire and WirePlumber as dedicated
service users, because they won't have to be able to access
XDG_RUNTIME_DIR.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
img/app/Makefile | 1 +
img/app/file-list.mk | 2 ++
img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR | 1 +
.../image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR.license | 2 ++
img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH | 1 +
.../image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH.license | 2 ++
img/app/image/etc/s6-rc/pipewire/run | 4 ++--
7 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR
create mode 100644 img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR.license
create mode 100644 img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH
create mode 100644 img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH.license

diff --git a/img/app/Makefile b/img/app/Makefile
index 48eba87..2838554 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -31,6 +31,7 @@ $(imgdir)/appvm/blk/root.img: ../../scripts/make-gpt.sh ../../scripts/sfdisk-fie
mv $@.tmp $@

DIRS = dev run proc sys tmp \
+ etc/s6-linux-init/run-image/pipewire \
etc/s6-linux-init/run-image/service \
etc/s6-linux-init/run-image/user \
etc/s6-linux-init/run-image/wait
diff --git a/img/app/file-list.mk b/img/app/file-list.mk
index c7cd82a..d63ee76 100644
--- a/img/app/file-list.mk
+++ b/img/app/file-list.mk
@@ -18,6 +18,8 @@ FILES = \
image/etc/s6-linux-init/env/DISPLAY \
image/etc/s6-linux-init/env/GTK_USE_PORTAL \
image/etc/s6-linux-init/env/NIX_XDG_DESKTOP_PORTAL_DIR \
+ image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR \
+ image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH \
image/etc/s6-linux-init/env/WAYLAND_DISPLAY \
image/etc/s6-linux-init/env/XDG_DESKTOP_PORTAL_SPECTRUM_GUEST_PORT \
image/etc/s6-linux-init/env/XDG_RUNTIME_DIR \
diff --git a/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR b/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR
new file mode 100644
index 0000000..8cb2f46
--- /dev/null
+++ b/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR
@@ -0,0 +1 @@
+/run/pipewire
diff --git a/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR.license b/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR.license
new file mode 100644
index 0000000..0d3d47c
--- /dev/null
+++ b/img/app/image/etc/s6-linux-init/env/PIPEWIRE_RUNTIME_DIR.license
@@ -0,0 +1,2 @@
+SPDX-License-Identifier: CC0-1.0
+SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
diff --git a/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH b/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH
new file mode 100644
index 0000000..8cb2f46
--- /dev/null
+++ b/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH
@@ -0,0 +1 @@
+/run/pipewire
diff --git a/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH.license b/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH.license
new file mode 100644
index 0000000..0d3d47c
--- /dev/null
+++ b/img/app/image/etc/s6-linux-init/env/PULSE_RUNTIME_PATH.license
@@ -0,0 +1,2 @@
+SPDX-License-Identifier: CC0-1.0
+SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
diff --git a/img/app/image/etc/s6-rc/pipewire/run b/img/app/image/etc/s6-rc/pipewire/run
index ab46901..1774b91 100644
--- a/img/app/image/etc/s6-rc/pipewire/run
+++ b/img/app/image/etc/s6-rc/pipewire/run
@@ -3,10 +3,10 @@
# SPDX-FileCopyrightText: 2023-2024 Alyssa Ross <hi@alyssa.is>
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>

-s6-ipcserver-socketbinder -B /run/user/0/pipewire-0
+s6-ipcserver-socketbinder -B /run/pipewire/pipewire-0
fdmove -c 3 0

-s6-ipcserver-socketbinder -B /run/user/0/pipewire-0-manager
+s6-ipcserver-socketbinder -B /run/pipewire/pipewire-0-manager
fdmove -c 4 0

redirfd -r 0 /dev/null
--
2.51.0