Skip to content

fix: load and manage upstream nvm with chezmoi - #39

Merged
MrPointer merged 2 commits into
mainfrom
fix/nvm-shell-loading
Oct 23, 2026
Merged

MrPointer merged 2 commits into
mainfrom
fix/nvm-shell-loading

Conversation

@MrPointer

Copy link
Copy Markdown
Owner

📝 Summary

Replaces the Homebrew-dependent nvm loader with an upstream nvm installation managed by chezmoi. Removing Homebrew nvm previously disabled the loader even when the official installation was present. Lazy loading and existing .nvmrc switching remain unchanged.

Key Decisions

Load nvm from its standard installation directory

The loader sets NVM_DIR=$HOME/.nvm and sources its nvm.sh on first use, without requiring Homebrew. It also loads the optional bundled bash_completion, which supports Zsh.

Manage the latest published release through chezmoi

.chezmoiexternal.toml.tmpl resolves the latest published nvm release once and downloads nvm.sh, executable nvm-exec, and bash_completion from that same tag. This avoids manual version pins and unreleased development changes. The externals use the existing 168-hour refresh convention; Node versions, aliases, and packages remain outside chezmoi management.

🔄 Before & After

Area Before After
nvm loading Requires Homebrew installation Loads official installation from ~/.nvm
Completions Not loaded by lazy loader Bundled completions loaded on first use
nvm installation and updates Not managed by chezmoi Latest published release managed by chezmoi
Shell behavior Lazy loading and .nvmrc switching Unchanged

Load nvm from ~/.nvm instead of requiring a Homebrew installation.
Preserve lazy loading and enable the bundled shell completions.
Fetch the three nvm runtime files from the latest published release
without pinning a version or managing installed Node versions.

Rename the externals file to make its template syntax explicit.
@MrPointer
MrPointer merged commit 98ceee0 into main Oct 23, 2026
5 checks passed
@MrPointer
MrPointer deleted the fix/nvm-shell-loading branch October 23, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant