[dev-box-test] image=ghcr.io/ublue-os/fedora-toolbox:latest # Stability and hardware isolation flags additional_flags="--memory=12g --cpus=4 --device /dev/kvm --device /dev/dri --device /dev/nvidiactl --device /dev/nvidia0 --device /dev/fuse --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --blkio-weight=400" # Cleaned package list: Removed already-installed mesa drivers and git # Swapped to a more compatible Java package name additional_packages="gh git vim curl nodejs npm tmux mesa-libGLES glx-utils java-21-openjdk-devel chattr podman podman-compose fuse-overlayfs" # init_hooks run as root at container init. Idempotent installs, each via its RECOMMENDED method: # 1. fnm (not a dnf package): static binary system-wide + Node LTS as default, into a SHARED # FNM_DIR so every user gets it (system paths avoid the per-user-home problem). Shell # activation is written system-wide to /etc/profile.d/fnm.sh (the base64 blob below) so # no ~/.bashrc edit is needed — every login shell picks up fnm automatically. # 2. Codex: recommended install is the npm package (@openai/codex) → into the fnm LTS Node. # 3. agy (Antigravity CLI): native installer with --dir → /usr/local/bin (recommended; sidesteps # Google's unsigned gpgcheck=0 dnf repo). Auth with `agy` at runtime. # 4. Claude Code: native installer. Hooks run as root but with HOME=/home/Messier82, so it # installs to ~/.local/bin like agy; we then chown it (and agy) back to uid 1000. The # trailing `|| true` keeps a Claude hiccup from failing the whole box init. # IMPORTANT: distrobox-assemble runs this value through MULTIPLE eval layers, which (a) expand # '$' under `set -u` and (b) STRIP quoting. So the string must contain NO '$' (no $VAR/$(...)/ # backticks) AND no quoted-grouping like `-c '...'`. The fnm `eval "$(...)"` is safe only because # it's hidden inside the base64 blob, decoded solely inside the container. init_hooks="export FNM_DIR=/usr/local/share/fnm ; command -v fnm >/dev/null 2>&1 || curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir /usr/local/bin --skip-shell ; /usr/local/bin/fnm install --lts ; /usr/local/bin/fnm default lts-latest ; /usr/local/bin/fnm exec --using=lts-latest -- npm install -g @openai/codex ; chmod -R a+rwX /usr/local/share/fnm ; echo IyBmbm0gKEZhc3QgTm9kZSBNYW5hZ2VyKSDigJQgc3lzdGVtLXdpZGUgYWN0aXZhdGlvbiwgd3JpdHRlbiBieSBkZXYtYm94LmluaSBpbml0X2hvb2tzCmlmIGNvbW1hbmQgLXYgZm5tID4vZGV2L251bGwgMj4mMTsgdGhlbgogIGV4cG9ydCBGTk1fRElSPS91c3IvbG9jYWwvc2hhcmUvZm5tCiAgZXZhbCAiJChmbm0gZW52IC0tdXNlLW9uLWNkKSIKZmkK | base64 -d > /etc/profile.d/fnm.sh ; command -v agy >/dev/null 2>&1 || curl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir /usr/local/bin ; [ -x /home/Messier82/.local/bin/claude ] || curl -fsSL https://claude.ai/install.sh | bash || true ; chown -R 1000:1000 /home/Messier82/.claude /home/Messier82/.local/bin 2>/dev/null || true" nvidia=true init=false