mirror of
https://github.com/nestriness/nestri.git
synced 2026-05-01 19:03:08 +03:00
feat: Init
This commit is contained in:
48
build/etc/nestri/configs/MangoHud/MangoHud.conf
Normal file
48
build/etc/nestri/configs/MangoHud/MangoHud.conf
Normal file
@@ -0,0 +1,48 @@
|
||||
legacy_layout=false
|
||||
|
||||
# common
|
||||
horizontal
|
||||
horizontal_stretch
|
||||
hud_no_margin
|
||||
no_small_font
|
||||
background_alpha=0.66
|
||||
round_corners=0
|
||||
background_color=000000
|
||||
font_size=24
|
||||
position=top-left
|
||||
engine_short_names
|
||||
|
||||
# colors
|
||||
text_color=DFDFDF
|
||||
gpu_color=FF4E00
|
||||
cpu_color=00AA00
|
||||
engine_color=00AA00
|
||||
vram_color=00AA00
|
||||
ram_color=00AA00
|
||||
frametime_color=FF4E00
|
||||
|
||||
# load colors
|
||||
cpu_load_color=DFDFDF,DF964D,DF3D3D
|
||||
gpu_load_color=DFDFDF,DF964D,DF3D3D
|
||||
|
||||
# GPU and VRAM
|
||||
gpu_text=NESTRI
|
||||
gpu_stats
|
||||
gpu_load_change
|
||||
gpu_load_value=70,90
|
||||
|
||||
vram
|
||||
|
||||
# CPU and RAM
|
||||
cpu_text=CPU
|
||||
cpu_stats
|
||||
cpu_load_change
|
||||
cpu_load_value=70,90
|
||||
|
||||
ram
|
||||
|
||||
# FPS and timing
|
||||
fps
|
||||
fps_metrics=0.01
|
||||
|
||||
frame_timing
|
||||
26
build/etc/pipewire/pipewire.conf.d/nestri-loopback.conf
Normal file
26
build/etc/pipewire/pipewire.conf.d/nestri-loopback.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
context.modules = [
|
||||
{
|
||||
name = libpipewire-module-loopback
|
||||
args = {
|
||||
node.description = "Nestri Audio"
|
||||
capture.props = {
|
||||
node.name = "nestri-sink"
|
||||
media.class = "Audio/Sink"
|
||||
media.type = "Audio"
|
||||
audio.position = [FL FR]
|
||||
node.always-process = true
|
||||
session.suspend-timeout-seconds = 0
|
||||
priority.session = 10000
|
||||
priority.driver = 10000
|
||||
}
|
||||
playback.props = {
|
||||
node.name = "nestri-source"
|
||||
media.class = "Audio/Source"
|
||||
media.type = "Audio"
|
||||
audio.position = [FL FR]
|
||||
node.always-process = true
|
||||
session.suspend-timeout-seconds = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
context.properties = {
|
||||
default.clock.rate = 48000
|
||||
default.clock.allowed-rates = [48000]
|
||||
default.clock.min-quantum = 128
|
||||
default.clock.max-quantum = 1024
|
||||
default.clock.quantum = 512
|
||||
}
|
||||
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
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"wireplumber.rules": [
|
||||
{
|
||||
"description": "Global audio format and rate for audio nodes",
|
||||
"matches": [
|
||||
{ "media.class": "Audio/Sink" },
|
||||
{ "media.class": "Audio/Source" }
|
||||
],
|
||||
"apply_properties": {
|
||||
"audio.format": "F32P",
|
||||
"audio.rate": 48000,
|
||||
"audio.channels": 2,
|
||||
"session.suspend-timeout-seconds": 0
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"description": "PulseAudio bridge specific tweaks",
|
||||
"matches": [
|
||||
{ "node.name": "pulse_sink" },
|
||||
{ "node.name": "pulse_source" }
|
||||
],
|
||||
"apply_properties": {
|
||||
"pulse.min.req": 128,
|
||||
"pulse.max.req": 1024,
|
||||
"pulse.idle.timeout": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user