You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bugfix: Nix image scaffolds dangling, read-only symlinks into a new workspace #664
Discovered during local testing of the Nix-image install flow (epic #625, prepping the #639 cutover).
dockerTools.buildLayeredImage represents the baked workspace template as symlinks into /nix/store — e.g. /root/assets/workspace/flake.nix -> /nix/store/<hash>-devcontainer-bootstrap/root/assets/workspace/flake.nix. assets/init-workspace.sh scaffolds a new workspace with rsync -a (-a implies -l, copy symlinks as symlinks). So a real install (host project dir bind-mounted into the container) produces dangling symlinks on the host — the store path exists only inside the image — and even when resolved they are read-only (0444, from the immutable store).
This is Nix-image-specific: the Debian ContainerfileCOPYs the assets as real, writable files, so the published image is unaffected.
Why CI missed it
The install/integration tests (test_integration.py, test_install_script.py) run against the Debian image (the build-image action's default). The Nix image only gets the portable testinfra suite (nix-image.yml), which never exercises the init/scaffold flow. So this was latent.
Repro
nix build .#devcontainerImage && docker load -i result
docker run --rm -v /tmp/dummy:/workspace ghcr.io/vig-os/devcontainer:<tag> \
/root/assets/init-workspace.sh --no-prompts --mode both
ls -la /tmp/dummy/flake.nix # => symlink into /nix/store (dangling on host)
Fix
assets/init-workspace.sh: rsync with --copy-links (dereference the store symlinks into real files) and chmod -R u+w "$WORKSPACE_DIR" after scaffolding (restore writability; keep the existing +x on *.sh/.githooks). Debian-safe (no-op there).
Regression guard
A static bats assertion that the scaffold rsync uses --copy-links and the workspace is made writable.
A behavioural step in nix-image.yml that scaffolds via the real Nix image and asserts there are no dangling symlinks (find -xtype l) and that flake.nix is a regular, writable file.
Acceptance criteria
A workspace scaffolded from the Nix image contains real, writable files (no /nix/store symlinks).
The install/scaffold flow is exercised against the Nix image in CI so this cannot regress.
Resolved on dev by PR #665 (fix(scripts): Nix image scaffolds real writable files, not store symlinks). assets/init-workspace.sh now dereferences Nix-store symlinks (rsync -avL) and restores write/exec perms (chmod -R u+w, +x on *.sh/.githooks), so scaffolding no longer plants dangling read-only symlinks.
Activity
fix(scripts): scaffold real writable files from the Nix image
fix(scripts): Nix image scaffolds real writable files, not store syml…
c-vigo commentedon Jul 1, 2026
Resolved on
devby PR #665 (fix(scripts): Nix image scaffolds real writable files, not store symlinks).assets/init-workspace.shnow dereferences Nix-store symlinks (rsync -avL) and restores write/exec perms (chmod -R u+w,+xon*.sh/.githooks), so scaffolding no longer plants dangling read-only symlinks.docs: retire the documented Debian fallback path (T4.4) (#889)
fix(workspace): survive a mid-scaffold abort without wiping .vig-os (#…