[BREAKING] Provide runtime environment systemd services from munix
These services evolve as munix evolves, so they should not be part of the system closures themselves. Mount them into /run/systemd instead. (Yes, making /run/systemd/system a symlink to RO files is unfortunate, that could be changed in the future. FS prep code is annoying too..)
This commit is contained in:
parent
604ebc1356
commit
38a96b79b3
18 changed files with 125 additions and 112 deletions
|
|
@ -0,0 +1 @@
|
|||
../muvm-configure-network.service
|
||||
1
systemd/microvm.target.wants/muvm-remote.service
Normal file
1
systemd/microvm.target.wants/muvm-remote.service
Normal file
|
|
@ -0,0 +1 @@
|
|||
../muvm-remote.service
|
||||
1
systemd/microvm.target.wants/pipewire-bridge.socket
Normal file
1
systemd/microvm.target.wants/pipewire-bridge.socket
Normal file
|
|
@ -0,0 +1 @@
|
|||
../pipewire-bridge.socket
|
||||
1
systemd/microvm.target.wants/session-bus-bridge.service
Normal file
1
systemd/microvm.target.wants/session-bus-bridge.service
Normal file
|
|
@ -0,0 +1 @@
|
|||
../session-bus-bridge.service
|
||||
1
systemd/microvm.target.wants/wayland-bridge.socket
Normal file
1
systemd/microvm.target.wants/wayland-bridge.socket
Normal file
|
|
@ -0,0 +1 @@
|
|||
../wayland-bridge.socket
|
||||
6
systemd/muvm-configure-network.service
Normal file
6
systemd/muvm-configure-network.service
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=microVM Network configuration
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/opt/bin/muvm-configure-network
|
||||
33
systemd/muvm-remote.service
Normal file
33
systemd/muvm-remote.service
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[Unit]
|
||||
After=sockets.target
|
||||
Description=microVM Application runner
|
||||
OnFailure=exit.target
|
||||
OnSuccess=exit.target
|
||||
Wants=sockets.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
# Environment="LOCALE_ARCHIVE=/nix/store/1hilqf0v1nm2w8xj87pwpm0rgq6lvhlv-glibc-locales-2.42-47/lib/locale/locale-archive"
|
||||
# Environment="TZDIR=/nix/store/80izpiglrlqv2zb7rd7m5274k2dr142l-tzdata-2025c/share/zoneinfo"
|
||||
Environment=WAYLAND_DISPLAY=wayland-1
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/vm-user/dbus.sock
|
||||
Environment=PATH=/run/current-system/sw/bin
|
||||
PassEnvironment=MESA_LOADER_DRIVER_OVERRIDE
|
||||
PassEnvironment=MUVM_REMOTE_CONFIG
|
||||
PassEnvironment=TERM
|
||||
PassEnvironment=XDG_SESSION_TYPE
|
||||
PassEnvironment=SDL_VIDEODRIVER
|
||||
PassEnvironment=QT_QPA_PLATFORM
|
||||
PassEnvironment=_JAVA_AWT_WM_NONREPARENTING
|
||||
PassEnvironment=ELECTRON_OZONE_PLATFORM_HINT
|
||||
PassEnvironment=GTK_USE_PORTAL
|
||||
PassEnvironment=QT_QPA_PLATFORMTHEME
|
||||
ExecStartPre=+/run/current-system/sw/bin/chown appvm:appvm /run/vm-user
|
||||
ExecStart=/opt/bin/muvm-remote
|
||||
ExecStopPost=+/nix/store/ygzfhw5nxrn7qqfqmz2s9p6cikcjqqkh-python3-3.13.11/bin/python -c "import os,fcntl,struct;print(os.getenv('EXIT_STATUS', '1'));fcntl.ioctl(os.open('/', os.O_RDONLY), 0x7602, int(os.getenv('EXIT_STATUS', '1')))"
|
||||
User=appvm
|
||||
Group=appvm
|
||||
StandardError=tty
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
TTYPath=/dev/hvc0
|
||||
12
systemd/pipewire-bridge.service
Normal file
12
systemd/pipewire-bridge.service
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=PipeWire VM bridge
|
||||
Requires=pipewire-bridge.socket
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/opt/bin/muvm-pwbridge
|
||||
|
||||
# Environment=RUST_LOG=debug
|
||||
# StandardError=tty
|
||||
# StandardOutput=tty
|
||||
# TTYPath=/dev/hvc0
|
||||
8
systemd/pipewire-bridge.socket
Normal file
8
systemd/pipewire-bridge.socket
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=PipeWire VM bridge socket
|
||||
PartOf=pipewire-bridge.service
|
||||
|
||||
[Socket]
|
||||
SocketGroup=appvm
|
||||
SocketUser=appvm
|
||||
ListenStream=/run/vm-user/pipewire-0
|
||||
11
systemd/session-bus-bridge.service
Normal file
11
systemd/session-bus-bridge.service
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
After=session-bus.service
|
||||
Description=D-Bus VM integration bridge
|
||||
Requires=session-bus.socket session-bus.service
|
||||
|
||||
[Service]
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/vm-user/dbus.sock
|
||||
ExecStartPre=+/run/current-system/sw/bin/chmod 0666 /dev/dri/card0 /dev/dri/renderD128
|
||||
ExecStart=/opt/bin/muvm-dbusbridge
|
||||
Group=appvm
|
||||
User=appvm
|
||||
13
systemd/wayland-bridge.service
Normal file
13
systemd/wayland-bridge.service
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Wayland VM bridge
|
||||
Requires=wayland-bridge.socket
|
||||
|
||||
[Service]
|
||||
ExecStartPre=+/run/current-system/sw/bin/chmod 0666 /dev/dri/card0 /dev/dri/renderD128
|
||||
ExecStart=/opt/bin/wl-cross-domain-proxy --listen-fd --filter-global wp_presentation
|
||||
User=appvm
|
||||
Group=appvm
|
||||
|
||||
StandardError=tty
|
||||
StandardOutput=tty
|
||||
TTYPath=/dev/hvc0
|
||||
9
systemd/wayland-bridge.socket
Normal file
9
systemd/wayland-bridge.socket
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Wayland VM bridge socket
|
||||
PartOf=wayland-bridge.service
|
||||
|
||||
[Socket]
|
||||
FileDescriptorName=wayland
|
||||
SocketGroup=appvm
|
||||
SocketUser=appvm
|
||||
ListenStream=/run/vm-user/wayland-1
|
||||
Loading…
Add table
Add a link
Reference in a new issue