claudebox/.planning/quick/260410-d4u-on-non-nixos-hosts-bwrap-fails-because-e/260410-d4u-PLAN.md
2026-04-10 09:46:51 +02:00

3 KiB

phase plan type wave depends_on files_modified autonomous must_haves
quick 260410-d4u execute 1
claudebox.sh
true
truths artifacts
claudebox launches successfully on non-NixOS Linux hosts where /etc/static does not exist
claudebox still mounts /etc/static on NixOS hosts where it does exist
dry-run output reflects the conditional mount accurately
path provides contains
claudebox.sh Conditional /etc/static mount etc/static
Fix bwrap failure on non-NixOS hosts caused by unconditional `--ro-bind /etc/static /etc/static`.

Purpose: /etc/static is NixOS-specific. On Ubuntu, Fedora, Arch, etc. this path does not exist and bwrap exits with an error, making claudebox unusable on non-NixOS Linux.

Output: claudebox.sh conditionally includes the /etc/static mount only when the path exists.

<execution_context> @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md </execution_context>

@claudebox.sh Task 1: Conditionally mount /etc/static only when it exists claudebox.sh Build a `CONDITIONAL_MOUNTS` array before the dry-run block (around line 284, after SANDBOX_CMD is set). Populate it conditionally:
# Conditional mounts for NixOS-specific paths
CONDITIONAL_MOUNTS=()
if [[ -d /etc/static ]]; then
  CONDITIONAL_MOUNTS+=(--ro-bind /etc/static /etc/static)
fi

Then splice "${CONDITIONAL_MOUNTS[@]}" into both:

  1. Dry-run output (line ~309): Replace the hardcoded echo " --ro-bind /etc/static /etc/static \\" with a loop over CONDITIONAL_MOUNTS that prints them in the same format:
local cm_i=0
while (( cm_i < ${#CONDITIONAL_MOUNTS[@]} )); do
  echo "  ${CONDITIONAL_MOUNTS[$cm_i]} ${CONDITIONAL_MOUNTS[$((cm_i+1))]} ${CONDITIONAL_MOUNTS[$((cm_i+2))]} \\"
  (( cm_i += 3 ))
done
  1. exec bwrap (line ~339): Replace --ro-bind /etc/static /etc/static \ with "${CONDITIONAL_MOUNTS[@]}" \ in the exec call.

This keeps the pattern simple -- one array, two splice points. No other mounts are affected. bash -n claudebox.sh && echo "syntax ok" - bash -n claudebox.sh passes (no syntax errors) - /etc/static mount is conditional on directory existence - Both dry-run and exec paths use the same CONDITIONAL_MOUNTS array - No other mounts are changed

- `bash -n claudebox.sh` passes - On NixOS: `claudebox --dry-run` output includes `--ro-bind /etc/static /etc/static` - On non-NixOS: `claudebox --dry-run` output omits the /etc/static line entirely

<success_criteria> claudebox.sh no longer fails on hosts without /etc/static, while preserving the mount on NixOS. </success_criteria>

After completion, create `.planning/quick/260410-d4u-on-non-nixos-hosts-bwrap-fails-because-e/260410-d4u-SUMMARY.md`