mirror of
https://github.com/nestriness/nestri.git
synced 2026-05-01 19:03:08 +03:00
feat: Init
This commit is contained in:
4
build/etc/systemd/system/microvm.target
Normal file
4
build/etc/systemd/system/microvm.target
Normal file
@@ -0,0 +1,4 @@
|
||||
[Unit]
|
||||
Description=Nestri microVM system
|
||||
AllowIsolate=yes
|
||||
Wants=systemd-journald.socket systemd-udevd.service dbus.socket
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-network.service
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-pipewire-pulse.socket
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-pwbridge.socket
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-remote.service
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-session-bus.socket
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-user-session.service
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-wayland-proxy.socket
|
||||
14
build/etc/systemd/system/nestri-network.service
Normal file
14
build/etc/systemd/system/nestri-network.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Configure VM network via muvm
|
||||
DefaultDependencies=no
|
||||
Before=network.target
|
||||
After=systemd-udevd.service
|
||||
Wants=microvm.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/opt/bin/muvm-configure-network
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
15
build/etc/systemd/system/nestri-pipewire-pulse.service
Normal file
15
build/etc/systemd/system/nestri-pipewire-pulse.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=PipeWire PulseAudio compatibility daemon
|
||||
Requires=nestri-pipewire-pulse.socket
|
||||
After=nestri-pwbridge.service
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStartPre=/bin/mkdir -p /run/vm-user/pulse
|
||||
ExecStart=/usr/bin/pipewire-pulse
|
||||
Environment=XDG_RUNTIME_DIR=/run/vm-user
|
||||
Environment=PIPEWIRE_RUNTIME_DIR=/run/vm-user
|
||||
User=nestri
|
||||
Group=nestri
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
13
build/etc/systemd/system/nestri-pipewire-pulse.socket
Normal file
13
build/etc/systemd/system/nestri-pipewire-pulse.socket
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=PipeWire PulseAudio compatibility socket
|
||||
PartOf=nestri-pipewire-pulse.service
|
||||
After=nestri-pwbridge.socket nestri-user-session.service
|
||||
Requires=nestri-pwbridge.socket nestri-user-session.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/vm-user/pulse/native
|
||||
SocketUser=nestri
|
||||
SocketGroup=nestri
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
12
build/etc/systemd/system/nestri-procsys-rw.service
Normal file
12
build/etc/systemd/system/nestri-procsys-rw.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Make /proc/sys writable for muvm
|
||||
DefaultDependencies=no
|
||||
Before=systemd-sysctl.service systemd-tmpfiles-setup.service
|
||||
After=local-fs-pre.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
# umount the ro bind mount; exit 0 so service succeeds
|
||||
# even if there's nothing to unmount (defensive)
|
||||
ExecStart=/bin/sh -c 'umount /proc/sys 2>/dev/null || true'
|
||||
7
build/etc/systemd/system/nestri-pwbridge.service
Normal file
7
build/etc/systemd/system/nestri-pwbridge.service
Normal file
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=PipeWire cross-domain proxy
|
||||
Requires=nestri-pwbridge.socket
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/opt/bin/muvm-pwbridge
|
||||
13
build/etc/systemd/system/nestri-pwbridge.socket
Normal file
13
build/etc/systemd/system/nestri-pwbridge.socket
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=PipeWire cross-domain proxy socket
|
||||
PartOf=nestri-pwbridge.service
|
||||
After=nestri-user-session.service
|
||||
Requires=nestri-user-session.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/vm-user/pipewire-0
|
||||
SocketUser=nestri
|
||||
SocketGroup=nestri
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
33
build/etc/systemd/system/nestri-remote.service
Normal file
33
build/etc/systemd/system/nestri-remote.service
Normal file
@@ -0,0 +1,33 @@
|
||||
[Unit]
|
||||
Description=microVM application runner
|
||||
OnFailure=exit.target
|
||||
OnSuccess=exit.target
|
||||
Wants=sockets.target
|
||||
After=sockets.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
PassEnvironment=MUVM_REMOTE_CONFIG MESA_LOADER_DRIVER_OVERRIDE TERM VK_DRIVER_FILES
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/vm-user/dbus.sock
|
||||
Environment=XDG_RUNTIME_DIR=/run/vm-user
|
||||
Environment=WAYLAND_DISPLAY=wayland-1
|
||||
Environment=XDG_SESSION_TYPE=wayland
|
||||
Environment=PULSE_SERVER=unix:/run/vm-user/pulse/native
|
||||
Environment=SDL_AUDIO_DRIVER=pipewire
|
||||
Environment=MESA_LOADER_DRIVER_OVERRIDE=zink
|
||||
Environment=GALLIUM_DRIVER=zink
|
||||
Environment=XAUTHORITY=/run/vm-user/xauth
|
||||
Environment=MANGOHUD_CONFIGFILE=/etc/nestri/configs/MangoHud/MangoHud.conf
|
||||
#Environment=SDL_VIDEODRIVER=wayland
|
||||
Environment=PATH=/usr/bin:/usr/sbin:/bin:/sbin
|
||||
User=root
|
||||
Group=root
|
||||
ExecStartPre=+/bin/chown nestri:nestri /run/vm-user
|
||||
ExecStart=/opt/bin/muvm-remote
|
||||
StandardOutput=tty
|
||||
StandardInput=tty
|
||||
StandardError=tty
|
||||
TTYPath=/dev/hvc0
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
9
build/etc/systemd/system/nestri-session-bus.service
Normal file
9
build/etc/systemd/system/nestri-session-bus.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=D-Bus session bus
|
||||
Requires=nestri-session-bus.socket
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --syslog-only
|
||||
User=nestri
|
||||
Group=nestri
|
||||
13
build/etc/systemd/system/nestri-session-bus.socket
Normal file
13
build/etc/systemd/system/nestri-session-bus.socket
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=D-Bus session bus socket
|
||||
PartOf=nestri-session-bus.service
|
||||
After=nestri-user-session.service
|
||||
Requires=nestri-user-session.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/vm-user/dbus.sock
|
||||
SocketUser=nestri
|
||||
SocketGroup=nestri
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
13
build/etc/systemd/system/nestri-user-session.service
Normal file
13
build/etc/systemd/system/nestri-user-session.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Prepare VM user runtime directory
|
||||
DefaultDependencies=no
|
||||
Before=nestri-wayland-proxy.socket nestri-pwbridge.socket nestri-session-bus.socket
|
||||
After=local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c 'mkdir -p /run/vm-user && chown 1000:1000 /run/vm-user && chmod 700 /run/vm-user'
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
12
build/etc/systemd/system/nestri-wayland-proxy.service
Normal file
12
build/etc/systemd/system/nestri-wayland-proxy.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Wayland cross-domain proxy
|
||||
Requires=nestri-wayland-proxy.socket
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStartPre=+/bin/chmod 0666 /dev/dri/card0 /dev/dri/renderD128
|
||||
ExecStart=/usr/bin/wl-cross-domain-proxy --listen-fd
|
||||
User=nestri
|
||||
Group=nestri
|
||||
StandardOutput=file:/tmp/wayland-proxy.log
|
||||
StandardError=file:/tmp/wayland-proxy-err.log
|
||||
14
build/etc/systemd/system/nestri-wayland-proxy.socket
Normal file
14
build/etc/systemd/system/nestri-wayland-proxy.socket
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Wayland cross-domain proxy socket
|
||||
PartOf=nestri-wayland-proxy.service
|
||||
After=nestri-user-session.service
|
||||
Requires=nestri-user-session.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/vm-user/wayland-1
|
||||
SocketUser=nestri
|
||||
SocketGroup=nestri
|
||||
FileDescriptorName=wayland
|
||||
|
||||
[Install]
|
||||
WantedBy=microvm.target
|
||||
@@ -0,0 +1 @@
|
||||
../nestri-procsys-rw.service
|
||||
Reference in New Issue
Block a user