From 04026c9a567d701eb5ce18ea80d3863265ef4182 Mon Sep 17 00:00:00 2001 From: Timor Gruber Date: Fri, 23 Oct 2026 22:08:39 +0300 Subject: [PATCH 1/2] fix nvm loading for the official installation Load nvm from ~/.nvm instead of requiring a Homebrew installation. Preserve lazy loading and enable the bundled shell completions. --- private_dot_local/share/zsh/scripts/nvm-lazy.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/private_dot_local/share/zsh/scripts/nvm-lazy.zsh b/private_dot_local/share/zsh/scripts/nvm-lazy.zsh index 085f0909..b716676d 100644 --- a/private_dot_local/share/zsh/scripts/nvm-lazy.zsh +++ b/private_dot_local/share/zsh/scripts/nvm-lazy.zsh @@ -8,12 +8,9 @@ # - Minimal overhead: precmd detector only does file checks (no subshells) # - chpwd hook only active while in a project -# Requires BREW_HOME to be set -[[ -z "$BREW_HOME" ]] && return -[[ ! -f "$BREW_HOME/opt/nvm/nvm.sh" ]] && return - # Export NVM_DIR for nvm to work properly export NVM_DIR="$HOME/.nvm" +[[ ! -s "$NVM_DIR/nvm.sh" ]] && return # Find .nvmrc from current dir up to git root (or current dir only if not in git repo) _nvm_find_project_nvmrc() { @@ -49,7 +46,10 @@ _nvm_load() { unfunction nvm node npm npx 2>/dev/null # Load nvm - source "$BREW_HOME/opt/nvm/nvm.sh" + source "$NVM_DIR/nvm.sh" + if [[ -s "$NVM_DIR/bash_completion" ]]; then + source "$NVM_DIR/bash_completion" + fi } # Full hook - only active while in a project From 39155db50014c3fbf23d3ffe646b83397dc95110 Mon Sep 17 00:00:00 2001 From: Timor Gruber Date: Fri, 23 Oct 2026 22:34:35 +0300 Subject: [PATCH 2/2] manage nvm updates through chezmoi externals 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. --- ...external.toml => .chezmoiexternal.toml.tmpl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) rename .chezmoiexternal.toml => .chezmoiexternal.toml.tmpl (67%) diff --git a/.chezmoiexternal.toml b/.chezmoiexternal.toml.tmpl similarity index 67% rename from .chezmoiexternal.toml rename to .chezmoiexternal.toml.tmpl index 11d495d9..b526065e 100644 --- a/.chezmoiexternal.toml +++ b/.chezmoiexternal.toml.tmpl @@ -1,3 +1,5 @@ +{{- $nvmRelease := (gitHubLatestRelease "nvm-sh/nvm").TagName | toString -}} + [".local/share/nvim/site/autoload/plug.vim"] type = "file" url = "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" @@ -27,3 +29,19 @@ refreshPeriod = "168h" type = "file" url = "https://raw.githubusercontent.com/eza-community/eza-themes/refs/heads/main/themes/tokyonight.yml" refreshPeriod = "168h" + +[".nvm/nvm.sh"] +type = "file" +url = "https://raw.githubusercontent.com/nvm-sh/nvm/{{ $nvmRelease }}/nvm.sh" +refreshPeriod = "168h" + +[".nvm/nvm-exec"] +type = "file" +url = "https://raw.githubusercontent.com/nvm-sh/nvm/{{ $nvmRelease }}/nvm-exec" +executable = true +refreshPeriod = "168h" + +[".nvm/bash_completion"] +type = "file" +url = "https://raw.githubusercontent.com/nvm-sh/nvm/{{ $nvmRelease }}/bash_completion" +refreshPeriod = "168h"