From b5aa2e03870bbbc59390b461a39430c590eacfc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Thu, 13 Aug 2026 02:47:08 +0000 Subject: [PATCH] keep the shell templates together in scripts/setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit starship.toml, tmux.conf and zshrc side by side. tmux.conf and zshrc moved up out of machine-setup/. starship.toml could not have moved down to join them: the PLATFORM reads it, at src/servers/os-user-shell.ts:34, to deploy to every member's Linux account. That is a runtime path rather than an import, so moving it would have broken member provisioning silently — no build error, members simply get no starship config. So the templates collect where the shared one already had to be. Left as a marker for tomorrow rather than resolved: there are now TWO zshrc templates, this one for the owner and shell-skel/zshrc for members, while starship.toml is deliberately one file for both. Either the owner needs different shell config from a member or they should be the same file. tmux.conf has the same question waiting, since it is going into provisioning too. Noted in the zshrc header where whoever picks it up will be looking. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/setup/machine-setup/machine-setup.sh | 16 ++++++++++------ scripts/setup/{machine-setup => }/tmux.conf | 0 scripts/setup/{machine-setup => }/zshrc | 20 ++++++++++++++++---- 3 files changed, 26 insertions(+), 10 deletions(-) rename scripts/setup/{machine-setup => }/tmux.conf (100%) rename scripts/setup/{machine-setup => }/zshrc (61%) diff --git a/scripts/setup/machine-setup/machine-setup.sh b/scripts/setup/machine-setup/machine-setup.sh index b8a997d7..8b8c2f0a 100755 --- a/scripts/setup/machine-setup/machine-setup.sh +++ b/scripts/setup/machine-setup/machine-setup.sh @@ -2225,11 +2225,15 @@ if ! skip; then esac fi - # `tmux.conf`, no leading dot. It is a TEMPLATE in the repository, not a - # dotfile in a home directory, and the destination is increasingly - # ~/.config/tmux/tmux.conf — which has no dot either. Naming the source after - # a path it may not be installed to is how you end up reading the wrong file. - if [[ -r "$SCRIPT_DIR/tmux.conf" ]]; then + # scripts/setup/tmux.conf, one level up — the shell templates live together + # beside starship.toml, which has to be there because the PLATFORM reads it + # too (os-user-shell.ts, for every member's Linux account). Keeping them in + # one directory means "where do the dotfile templates live" has one answer. + # + # No leading dot on any of them: they are templates in a repository, not + # dotfiles in a home directory, and tmux's destination is increasingly + # ~/.config/tmux/tmux.conf, which has no dot either. + if [[ -r "$SCRIPT_DIR/../tmux.conf" ]]; then # Not always ~/.tmux.conf — see tmux_config_target. tmux 3.1+ prefers # ~/.config/tmux/tmux.conf, so writing the old path on a machine that has # the new one produces a file tmux never reads and a success message that @@ -2240,7 +2244,7 @@ if ! skip; then echo " Targeting the one it actually reads: ${TMUX_TARGET}" fi install -d -m 0755 -o "$USERNAME" -g "$(user_group)" "$(dirname "$TMUX_TARGET")" - install_config "$SCRIPT_DIR/tmux.conf" "$TMUX_TARGET" "$USERNAME" && RC=0 || RC=$? + install_config "$SCRIPT_DIR/../tmux.conf" "$TMUX_TARGET" "$USERNAME" && RC=0 || RC=$? case $RC in 0) ok "tmux config installed — ${TMUX_TARGET}" ;; 1) echo " tmux config already matches (${TMUX_TARGET})" ;; diff --git a/scripts/setup/machine-setup/tmux.conf b/scripts/setup/tmux.conf similarity index 100% rename from scripts/setup/machine-setup/tmux.conf rename to scripts/setup/tmux.conf diff --git a/scripts/setup/machine-setup/zshrc b/scripts/setup/zshrc similarity index 61% rename from scripts/setup/machine-setup/zshrc rename to scripts/setup/zshrc index a999d199..c701db62 100644 --- a/scripts/setup/machine-setup/zshrc +++ b/scripts/setup/zshrc @@ -20,11 +20,23 @@ # destination is missing or still byte-for-byte the template, and offers a diff # otherwise, so an owner's own edits are never overwritten. # -# ── Naming ── +# ── Where the shell templates live ── # -# `zshrc`, no leading dot. It is a template in a repository, not a dotfile in a -# home directory — the same reason tmux.conf lost its dot beside it. The member -# equivalent, src/servers/shell-skel/zshrc, has been spelled that way all along. +# scripts/setup/{starship.toml, tmux.conf, zshrc}, together. starship.toml has to +# be here rather than inside machine-setup/, because the PLATFORM reads it too — +# os-user-shell.ts:34 deploys it to every member's Linux account — so it is not +# machine-setup's private file. The other two joined it so there is one answer to +# "where do the dotfile templates live". +# +# No leading dot on any of them: templates in a repository, not dotfiles in a +# home directory. src/servers/shell-skel/zshrc has been spelled that way all +# along. +# +# `[open]` TOMORROW. There are now two zshrc templates — this one for the owner +# and shell-skel/zshrc for members — while starship.toml is deliberately ONE file +# for both audiences. Either the owner genuinely needs different shell config +# from a member, or these should be the same file the way starship is. The tmux +# config has the same question waiting, since it is going into provisioning too. # # ── The one thing worth keeping when this is filled in ── #