From c34cf3641bc20f7d6d7d0acdd4eb1af426a74ec3 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Thu, 23 Apr 2026 20:39:40 +0200 Subject: [PATCH] Add devbox-shell bridge line to baked .bash_aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the host bind-mounts ~/.config/devbox-shell/ into the container (the directory-mount pattern that avoids single-file inode breakage), the container needs a bridge line in .bashrc or .bash_aliases to source the mounted file. Previously this bridge had to be re-added manually after every --force-recreate because it lived in the container's writable layer. Baking it into the skel .bash_aliases makes it automatic: every fresh container sources ~/.config/devbox-shell/bash_aliases if it exists, with zero manual steps. Hosts that don't use the devbox-shell pattern are unaffected — the [ -r ... ] test silently skips. --- rootfs/home/developer/.bash_aliases | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rootfs/home/developer/.bash_aliases b/rootfs/home/developer/.bash_aliases index ca9e902..02e1bc4 100644 --- a/rootfs/home/developer/.bash_aliases +++ b/rootfs/home/developer/.bash_aliases @@ -3,6 +3,15 @@ # To override, bind-mount your host's ~/.bash_aliases over this file # via docker-compose.yml. +# ── Host-shared shell customizations (devbox-shell bridge) ─────────── +# If the host bind-mounts a directory at ~/.config/devbox-shell/ (the +# recommended pattern for sharing aliases/PATH/utilities between host +# and container), source the bash_aliases file from it. This survives +# --force-recreate because it's baked into the image's skel, not the +# container's writable layer. Hosts that don't use this pattern are +# unaffected — the test silently skips if the file doesn't exist. +[ -r "$HOME/.config/devbox-shell/bash_aliases" ] && . "$HOME/.config/devbox-shell/bash_aliases" + # ── History persistence and quality ────────────────────────────────── # The named volume devbox-shell-history is mounted at ~/.cache/bash # so history survives container recreation.