box/templates/blank/user-data.yaml
dan-claude-bot 9849021b6a feat: global install (#71) and tmux in templates (#65)
#71 — run as root, box installs once to /opt/box (world-readable) with a
/usr/local/bin shim, so every operator on a shared host has `box` on PATH
instead of `command not found`. Per-user ($HOME/.local) install is
byte-identical to before; BOX_HOME/BOX_BIN still override. A per-user tree
under /root is 0700 and unreadable to everyone else — the whole fleet got
`command not found` — so the root branch lands in a system location and
chmod -R a+rX's it, guarded on root. This is the path rig installs box through
(rig#24's `box` role).

#65 — `box tmux` runs `tmux new-session` inside the box, but the templates did
not install tmux, so it failed with `tmux: command not found`. tmux is now in
each template's cloud-init package list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 00:01:15 +00:00

15 lines
609 B
YAML

#cloud-config
# The whole template: create the user and stop. BOX_USER in box.env must
# match the name here — the file is passed to Incus verbatim.
users:
- name: dev
shell: /bin/bash
sudo: "ALL=(ALL) NOPASSWD:ALL"
lock_passwd: true
package_update: false
# The one package a blank box still needs: 'box tmux' runs 'tmux new-session'
# INSIDE the box, and a bare Debian image ships no tmux — without this it fails
# with "tmux: command not found" (#65). cloud-init refreshes the apt lists on its
# own whenever 'packages' is non-empty, so package_update stays false here.
packages:
- tmux