systemd: hoist XDG_RUNTIME_DIR up to manager defaults

In some cases it might be needed in arbitrary services.. such as mpd
needing PipeWire to play sound into
This commit is contained in:
Val Packett 2025-12-05 04:08:27 -03:00
parent 73d2501781
commit bfc037e615

View file

@ -159,6 +159,8 @@ in {
# Configure services
systemd.settings.Manager.DefaultEnvironment = "XDG_RUNTIME_DIR=${runtimeDir}";
systemd.services.muvm-remote = {
enable = true;
description = "microVM Application runner";
@ -171,7 +173,6 @@ in {
Type = "exec";
PassEnvironment = ["TERM" "MESA_LOADER_DRIVER_OVERRIDE" "MUVM_REMOTE_CONFIG"]; # "KRUN_CONFIG"];
Environment = [
"XDG_RUNTIME_DIR=${runtimeDir}"
"WAYLAND_DISPLAY=wayland-1"
"DBUS_SESSION_BUS_ADDRESS=unix:path=${runtimeDir}/sidebus.sock"
"PATH=/run/current-system/sw/bin"
@ -229,7 +230,6 @@ in {
serviceConfig = {
ExecStartPre = "+/run/current-system/sw/bin/chmod 0666 /dev/dri/card0 /dev/dri/renderD128";
ExecStart = "${virtwl.packages.${system}.proxy}/bin/wayland-proxy-virtwl --virtio-gpu";
Environment = ["XDG_RUNTIME_DIR=${runtimeDir}"];
User = "appvm";
Group = "appvm";
};