fix(shell): use single ~/.config/zsh/local.zsh for machine local

Replace the local/ directory of split env/login/interactive files with
one always-on local.zsh sourced from .zshenv. Deploy migrates old
fragments and never overwrites local.zsh.
This commit is contained in:
Jeffrey
2026-08-06 14:41:31 +08:00
parent f8dcc29a2f
commit caac9235f6
11 changed files with 99 additions and 81 deletions
+6 -13
View File
@@ -27,8 +27,7 @@ every zsh login only interactive only
────────── ────────── ────────────────
~/.zshenv (stub) ~/.zprofile (stub) ~/.zshrc (stub)
→ config/zsh/env/* → config/zsh/login/* → config/zsh/interactive/*
local/env.local.zsh → local/login.local.zsh → ~/.config/zshrc/* (before omz)
→ local/interactive.local.zsh
config/zsh/local.zsh → ~/.config/zshrc/* (before omz)
```
PATH for user tools is built **once** in `~/.config/zsh/env/00-path.zsh`
@@ -41,7 +40,7 @@ PATH for user tools is built **once** in `~/.config/zsh/env/00-path.zsh`
| `~/.config/zsh/env/` | Managed always-on env (PATH, Homebrew) | Overwritten |
| `~/.config/zsh/interactive/` | Managed interactive UX (omz, aliases) | Overwritten |
| `~/.config/zsh/login/` | Managed login hooks (usually empty) | Overwritten |
| `~/.config/zsh/local/*` | Machine-local env/login/interactive | **Never overwritten** |
| `~/.config/zsh/local.zsh` | Machine-local overrides (every zsh) | **Never overwritten** |
| `~/.config/zshrc/*.zsh` | Personal/tool overlays (before omz) | Left alone |
| `~/.local/bin/` | User tools + intentional shims (e.g. `grok`) | Left alone |
@@ -50,18 +49,12 @@ other tools). Link wanted entrypoints into `~/.local/bin` instead.
## Personal configuration
### Always-on (agents see this)
### Machine-local (agents see this)
```bash
# ~/.config/zsh/local/env.local.zsh
# ~/.config/zsh/local.zsh
. "$HOME/.cargo/env"
```
### Login only (vendor hooks)
```bash
# ~/.config/zsh/local/login.local.zsh
# OrbStack, MacPorts, product installers — not primary PATH policy
source ~/.orbstack/shell/init.zsh 2>/dev/null || :
```
### Interactive overlays (before oh-my-zsh)
@@ -81,4 +74,4 @@ curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash
Current fragments: `fnm`, `nvm`, `pyenv`, `p10k`, `merlin_devbox`, `merlin_worker`.
Aliases that must beat oh-my-zsh belong after omz loads (see managed
`interactive/20-post-omz.zsh`) or in `~/.config/zsh/local/interactive.local.zsh`.
`interactive/20-post-omz.zsh`).