feat: WIP s6-overlay and friends

This commit is contained in:
DatCaptainHorse
2026-02-19 18:02:10 +02:00
parent b743dab332
commit 34afd371ad
96 changed files with 2340 additions and 1063 deletions

View File

@@ -0,0 +1,23 @@
# Container build arguments #
ARG RUNNER_COMMON_IMAGE=runner-common:latest
#*********************#
# Final Runtime Stage #
#*********************#
FROM ${RUNNER_COMMON_IMAGE}
### FLAVOR/VARIANT CONFIGURATION ###
## Hyprland Desktop ##p
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm --needed hyprland hyprpaper hyprlock hypridle hyprpicker waybar waypaper xdg-desktop-portal-gtk xdg-desktop-portal-hyprland && \
# Cleanup
paccache -rk1 && \
rm -rf /usr/share/{info,man,doc}/*
## FLAVOR/VARIANT LAUNCH COMMAND ##
ENV NESTRI_LAUNCH_COMPOSITOR="Hyprland"
### END OF FLAVOR/VARIANT CONFIGURATION ###
### REQUIRED DEFAULT ENTRYPOINT FOR FLAVOR/VARIANT ###
USER root
ENTRYPOINT ["supervisord", "-c", "/etc/nestri/supervisord.conf"]

View File

@@ -0,0 +1,39 @@
# Container build arguments #
ARG RUNNER_COMMON_IMAGE=runner-common:latest
#*********************#
# Final Runtime Stage #
#*********************#
FROM ${RUNNER_COMMON_IMAGE}
### FLAVOR/VARIANT CONFIGURATION ###
## KDE Plasma Desktop ##
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm --needed plasma-desktop plasma-wayland-protocols kscreen konsole && \
# Cleanup
paccache -rk1 && \
rm -rf /usr/share/{info,man,doc}/*
## Custom wrapper launch script
COPY <<-'EOT' /tmp/nestri/plasmadesktop-launcher
#!/bin/bash
set -euo pipefail
mkdir -p /tmp/nestri
sudo -E chown -R "${NESTRI_USER}:${NESTRI_USER}" /tmp/nestri
cat <<EOF > /tmp/nestri/kwin_wayland_wrapper
#!/bin/sh
/usr/bin/kwin_wayland_wrapper --no-lockscreen --width $WIDTH --height $HEIGHT --xwayland \$@
EOF
chmod a+x /tmp/nestri/kwin_wayland_wrapper
export PATH=/tmp/nestri/:$PATH
dbus-launch startplasma-wayland
rm /tmp/nestri/kwin_wayland_wrapper
EOT
RUN chmod +x /tmp/nestri/plasmadesktop-launcher
## FLAVOR/VARIANT LAUNCH COMMAND ##
ENV NESTRI_LAUNCH_COMPOSITOR="/tmp/nestri/plasmadesktop-launcher"
### END OF FLAVOR/VARIANT CONFIGURATION ###

View File

@@ -17,7 +17,3 @@ RUN --mount=type=cache,target=/var/cache/pacman/pkg \
## FLAVOR/VARIANT LAUNCH COMMAND ##
ENV NESTRI_LAUNCH_CMD="heroic"
### END OF FLAVOR/VARIANT CONFIGURATION ###
### REQUIRED DEFAULT ENTRYPOINT FOR FLAVOR/VARIANT ###
USER root
ENTRYPOINT ["supervisord", "-c", "/etc/nestri/supervisord.conf"]

View File

@@ -18,7 +18,3 @@ RUN --mount=type=cache,target=/var/cache/pacman/pkg \
## FLAVOR/VARIANT LAUNCH COMMAND ##
ENV NESTRI_LAUNCH_CMD="minecraft-launcher"
### END OF FLAVOR/VARIANT CONFIGURATION ###
### REQUIRED DEFAULT ENTRYPOINT FOR FLAVOR/VARIANT ###
USER root
ENTRYPOINT ["supervisord", "-c", "/etc/nestri/supervisord.conf"]

View File

@@ -3,12 +3,10 @@ WORKDIR /builder
COPY packages/relay/ /builder/
RUN go build
FROM docker.io/golang:1.25-alpine
FROM docker.io/alpine:3.23
COPY --from=go-build /builder/relay /relay/relay
WORKDIR /relay
# TODO: Switch running layer to just alpine (doesn't need golang dev stack)
# ENV flags
ENV REGEN_IDENTITY=false
ENV VERBOSE=false

View File

@@ -9,5 +9,5 @@ FROM ${BASE_IMAGE} AS bases
# Only lightweight stuff needed by both builder and runtime
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -Sy --noconfirm \
libssh2 curl wget libevdev libc++abi \
libssh2 curl wget libevdev libc++abi libselinux \
gstreamer gst-plugins-base

View File

@@ -15,13 +15,14 @@ ENV CARGO_HOME=/usr/local/cargo \
# Install build essentials and caching tools
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm rustup git base-devel mold \
pacman -S --noconfirm rustup git base-devel \
meson pkgconf cmake git gcc make
# Override various linker with symlink so mold is forcefully used (ld, ld.lld, lld)
RUN ln -sf /usr/bin/mold /usr/bin/ld && \
ln -sf /usr/bin/mold /usr/bin/ld.lld && \
ln -sf /usr/bin/mold /usr/bin/lld
# Override various linkers with symlink so wild is forcefully used (ld, ld.lld, lld)
# Removed for time being until Wild is more stable
#RUN ln -sf /usr/bin/wild /usr/bin/ld && \
# ln -sf /usr/bin/wild /usr/bin/ld.lld && \
# ln -sf /usr/bin/wild /usr/bin/lld
# Install latest Rust using rustup
RUN rustup default stable
@@ -41,7 +42,7 @@ RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm lib32-gcc-libs
# Clone repository
RUN git clone --depth 1 --rev "2fde5376b6b9a38cdbd94ccc6a80c9d29a81a417" https://github.com/DatCaptainHorse/vimputti.git
RUN git clone --depth 1 --rev "cd306e954842082916107f12d3940e1093662033" https://github.com/DatCaptainHorse/vimputti.git
#--------------------------------------------------------------------
FROM vimputti-manager-deps AS vimputti-manager-planner
@@ -130,7 +131,7 @@ RUN --mount=type=cache,target=${CARGO_HOME}/registry \
cargo install cargo-c
# Clone repository
RUN git clone --depth 1 --rev "67b1183997fd7aaf57398e4b01bd64c4d2433c45" https://github.com/games-on-whales/gst-wayland-display.git
RUN git clone --depth 1 --rev "fd620860f260f051fd731bb9feaac8632cbe3c9e" https://github.com/games-on-whales/gst-wayland-display.git
#--------------------------------------------------------------------
FROM gst-wayland-deps AS gst-wayland-planner
@@ -168,7 +169,7 @@ WORKDIR /builder
# Install build dependencies
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm libtool libcap libselinux
pacman -S --noconfirm libtool libcap
# Copy patch file from host
COPY packages/patches/bubblewrap/ /builder/patches/

View File

@@ -12,20 +12,20 @@ FROM runtime
### Package Installation ###
# Core system components
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --needed --noconfirm \
vulkan-intel lib32-vulkan-intel vpl-gpu-rt \
vulkan-radeon lib32-vulkan-radeon \
mesa lib32-mesa vulkan-mesa-layers lib32-vulkan-mesa-layers \
gtk3 lib32-gtk3 \
sudo xorg-xwayland seatd libinput gamescope mangohud wlr-randr \
pipewire pipewire-pulse pipewire-alsa wireplumber \
noto-fonts-cjk supervisor jq pacman-contrib \
hwdata openssh \
pacman -S --needed --noconfirm --assume-installed bubblewrap \
vulkan-intel vpl-gpu-rt \
vulkan-radeon \
mesa vulkan-mesa-layers \
gtk3 \
sudo xorg-xwayland seatd libinput gamescope mangohud wlr-randr \
pipewire pipewire-pulse pipewire-alsa wireplumber \
noto-fonts-cjk jq pacman-contrib \
hwdata openssh \
# GStreamer stack
gst-plugins-good \
gst-plugins-bad gst-plugin-pipewire \
gst-plugin-webrtchttp gst-plugin-rswebrtc gst-plugin-rsrtp \
gst-plugin-va gst-plugin-qsv && \
gst-plugins-good \
gst-plugins-bad gst-plugin-pipewire \
gst-plugin-webrtchttp gst-plugin-rswebrtc gst-plugin-rsrtp \
gst-plugin-va gst-plugin-qsv && \
# Cleanup
paccache -rk1 && \
rm -rf /usr/share/{info,man,doc}/*
@@ -56,33 +56,44 @@ RUN mkdir -p "/home/${NESTRI_USER}" && \
RUN mkdir -p /run/dbus && \
# Wireplumber suspend disable
sed -i -z \
-e 's/{[[:space:]]*name = node\/suspend-node\.lua,[[:space:]]*type = script\/lua[[:space:]]*provides = hooks\.node\.suspend[[:space:]]*}[[:space:]]*//g' \
-e '/wants = \[/{s/hooks\.node\.suspend\s*//; s/,\s*\]/]/}' \
/usr/share/wireplumber/wireplumber.conf
-e 's/{[[:space:]]*name = node\/suspend-node\.lua,[[:space:]]*type = script\/lua[[:space:]]*provides = hooks\.node\.suspend[[:space:]]*}[[:space:]]*//g' \
-e '/wants = \[/{s/hooks\.node\.suspend\s*//; s/,\s*\]/]/}' \
/usr/share/wireplumber/wireplumber.conf
## Audio Systems Configs - Latency optimizations + Loopback ##
RUN mkdir -p /etc/pipewire/pipewire.conf.d && \
mkdir -p /etc/wireplumber/wireplumber.conf.d
COPY packages/configs/wireplumber.conf.d/* /etc/wireplumber/wireplumber.conf.d/
COPY packages/configs/pipewire.conf.d/* /etc/pipewire/pipewire.conf.d/
COPY packages/configs/wireplumber.conf.d/*.conf /etc/wireplumber/wireplumber.conf.d/
COPY packages/configs/pipewire.conf.d/*.conf /etc/pipewire/pipewire.conf.d/
## MangoHud Config ##
COPY packages/configs/MangoHud/MangoHud.conf /etc/nestri/configs/MangoHud/
### Artifacts from Builder ###
COPY --from=builder /artifacts/bin/nestri-server /usr/bin/
COPY --from=builder /artifacts/bin/bwrap /usr/bin/
COPY --from=builder /artifacts/bin/bwrap /usr/sbin/
COPY --from=builder /artifacts/lib/ /usr/lib/
COPY --from=builder /artifacts/lib32/ /usr/lib32/
COPY --from=builder /artifacts/lib64/ /usr/lib64/
COPY --from=builder /artifacts/bin/vimputti-manager /usr/bin/
### Scripts and Final Configuration ###
## Scripts ##
COPY packages/scripts/ /etc/nestri/
RUN chmod +x /etc/nestri/{envs.sh,entrypoint*.sh} && \
RUN chmod +x /etc/nestri/{envs.sh,entrypoint*.sh,pressure-vent.sh} && \
chown -R "${NESTRI_USER}:${NESTRI_USER}" "${NESTRI_HOME}" && \
sed -i 's/^#\(en_US\.UTF-8\)/\1/' /etc/locale.gen && \
setcap cap_net_admin+ep /usr/bin/vimputti-manager && \
setcap cap_mknod+ep /usr/bin/vimputti-manager && \
dbus-uuidgen > /etc/machine-id && \
LANG=en_US.UTF-8 locale-gen
## s6-overlay ##
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.2.0/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.2.0/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
COPY packages/configs/s6-overlay/ /etc/s6-overlay/s6-rc.d/
RUN chmod +x /etc/s6-overlay/s6-rc.d/*/run
ENTRYPOINT ["/init"]

View File

@@ -9,7 +9,9 @@ FROM ${RUNNER_COMMON_IMAGE}
### FLAVOR/VARIANT CONFIGURATION ###
## STEAM ##
RUN --mount=type=cache,target=/var/cache/pacman/pkg \
pacman -S --noconfirm steam && \
pacman -S --noconfirm --assume-installed bubblewrap \
steam \
lib32-mesa lib32-vulkan-mesa-layers lib32-vulkan-intel lib32-vulkan-radeon && \
# Cleanup
paccache -rk1 && \
rm -rf /usr/share/{info,man,doc}/*
@@ -19,9 +21,6 @@ RUN mkdir -p "${NESTRI_HOME}/.local/share/Steam/config"
COPY packages/configs/steam/config.vdf "${NESTRI_HOME}/.local/share/Steam/config/"
## FLAVOR/VARIANT LAUNCH COMMAND ##
ENV NESTRI_LAUNCH_CMD="steam -tenfoot -cef-force-gpu"
ENV NESTRI_LAUNCH_COMPOSITOR="gamescope --backend wayland --force-grab-cursor -g -f -W \$WIDTH -H \$HEIGHT -r \$FRAMERATE --mangoapp -e"
ENV NESTRI_LAUNCH_CMD="env DISPLAY=:0 steam -tenfoot -cef-force-gpu"
### END OF FLAVOR/VARIANT CONFIGURATION ###
### REQUIRED DEFAULT ENTRYPOINT FOR FLAVOR/VARIANT ###
USER root
ENTRYPOINT ["supervisord", "-c", "/etc/nestri/supervisord.conf"]