dotfiles/install/lib/extras.sh
Brian Pooe 5123fb4349 fix: config review fixes
- .gitconfig: correct misspelled user email, fix del-remote alias
  (expanded to 'git git remote prune'), filter 'today' to own commits
- .zshrc: guard lt() shift with no args, drop duplicate ~/.local/bin
  PATH entry, dedupe history (HIST_IGNORE_ALL_DUPS, HIST_IGNORE_SPACE)
- wezterm: fix hyperlink regex char class (0.9 -> 0-9)
- extras: bump nvm to v0.40.5 with verified installer checksum

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 21:16:01 +02:00

45 lines
1.3 KiB
Bash

#!/bin/bash
# Per-user helpers not managed by brew: nvm (official installer) + tpm.
NVM_VERSION="${NVM_VERSION:-v0.40.5}"
NVM_INSTALL_SHA256="${NVM_INSTALL_SHA256:-582070e4c44452c1d8d68e16fc786c2216ecba6bc6bf18dc280a03fdba6ed1a9}"
install_nvm() {
if [[ -s $HOME/.nvm/nvm.sh ]]; then
info "nvm already installed"
else
info "Installing nvm ($NVM_VERSION)..."
local installer
installer="$(mktemp)"
download_verified \
"https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" \
"$NVM_INSTALL_SHA256" \
"$installer"
PROFILE=/dev/null bash "$installer" ||
warn "nvm install failed (install manually if you need Node)"
rm -f "$installer"
fi
if [[ -s $HOME/.nvm/nvm.sh ]]; then
# Mason needs npm for its Node-backed language servers and tools.
# Keep Node owned by nvm rather than installing the distro nodejs package.
source "$HOME/.nvm/nvm.sh"
nvm install --lts
nvm alias default 'lts/*'
fi
}
install_tpm() {
if [[ -d $HOME/.tmux/plugins/tpm ]]; then
info "tpm already installed"
return
fi
info "Installing tmux plugin manager..."
git clone --depth 1 https://github.com/tmux-plugins/tpm \
"$HOME/.tmux/plugins/tpm" || warn "tpm clone failed"
}
install_all_extras() {
install_nvm
install_tpm
}