mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-19 17:25:19 +03:00
Get this thing going..
<!-- greptile_comment -->
<!-- greptile_summary -->
<h2><a
href="https://app.greptile.com/api/retrigger?id=63134761"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=1"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=1"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=1"
align="right"></picture></a>Confidence Score: 5/5</h2>
The PR appears safe to merge; all previous findings are resolved and the
latest readiness change introduces no established actionable regression.
<h3>Summary</h3>
- Establishes required guest filesystems, runtime directories, device
permissions, and service processes.
- Reports initialization and service deaths over the lifecycle channel.
- Supports launch, restart, and shutdown commands for a resident guest.
- Separates service and workload identities and configures per-launch
runtime environments.
- Removes the currently inactive nescope screenshot option and makes
capture-chain verification fail explicitly when compositor readback is
unavailable.
- Reworks the guest image around `nesinit` as PID 1 without a
distribution service manager.
<h3>Diagram</h3>
```mermaid
sequenceDiagram
participant Host
participant Init as nesinit
participant FS as Guest filesystems
participant Services as Service stack
participant Workload
Init->>Host: Ready(protocol version)
Host->>Init: Boot(mount descriptors)
Init->>FS: Establish and mount shares
Init->>Services: Spawn services in order
Services-->>Init: Required sockets ready
Init->>Host: Initialized(service names)
Host->>Init: Launch(id, exec, on_exit)
Init->>Workload: Spawn with isolated UID/runtime
Init->>Host: Started(id)
Workload-->>Init: Exit status
Init->>Host: WorkloadExited(id, status)
Host->>Init: Launch / Restart / Shutdown
```
<sub>Reviews (4) · Last reviewed commit: ["fix(nesinit): readiness is a
socket
that..."](731d34df9d)</sub>
<!-- /greptile_comment -->
---------
Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
36 lines
1.5 KiB
Bash
36 lines
1.5 KiB
Bash
# Nestri user environment — sourced for nestri user logins and su -
|
|
if [ "$(id -u)" = "1000" ]; then
|
|
export XDG_RUNTIME_DIR="/run/user/1000"
|
|
export XDG_CONFIG_HOME="${HOME}/.config"
|
|
export XDG_DATA_HOME="${HOME}/.local/share"
|
|
export XDG_CACHE_HOME="${HOME}/.cache"
|
|
export XDG_STATE_HOME="${HOME}/.local/state"
|
|
|
|
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
|
|
|
|
# Portal backend selection. "GTK" matches xdg-desktop-portal-gtk.
|
|
# Once nescope supports wlr portals, change to "wlroots" or similar.
|
|
#export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:-GTK}"
|
|
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:-wayland}"
|
|
export XDG_SESSION_DESKTOP="${XDG_SESSION_DESKTOP:-nestri}"
|
|
|
|
|
|
# Ensure standard XDG dirs exist
|
|
mkdir -p "${XDG_CONFIG_HOME}" "${XDG_DATA_HOME}" "${XDG_CACHE_HOME}" "${XDG_STATE_HOME}" 2>/dev/null || true
|
|
fi
|
|
|
|
# OpenGL -> Vulkan, for anybody who reaches a shell in here.
|
|
#
|
|
# Outside the uid test above on purpose, and duplicated from the init on
|
|
# purpose. This file is only ever read by a person who got a shell in a box --
|
|
# nothing a box runs is started from a login, so every service and every
|
|
# workload is exec'd with a cleared environment and never sees this. The init
|
|
# sets the same three for what it starts.
|
|
#
|
|
# It is here so that a debug shell renders the way a session does. A shell that
|
|
# silently has no GL driver is how somebody concludes the image is broken while
|
|
# the image is fine.
|
|
export __GLX_VENDOR_LIBRARY_NAME=mesa
|
|
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
|
export GALLIUM_DRIVER=zink
|