Files
Panama/config/bash/shell
T
Gabriel Brown 725e274ef4 Install the Node this shell config has always assumed
config/bash/shell sources /etc/profile.d/nvm.sh, switches Node per project from
.nvmrc, and puts PNPM_HOME on PATH. None of it worked on a fresh machine. nvm
was never installed -- it is a Terra package, present here since before Panama
-- and the source was unconditional, so every shell on a new box opened with an
error before it got as far as failing to find nvm.

That is the second instance of the same bug. $HOME/.cargo/env was the first, and
fixing it one file at a time is why this one survived: the dependency contract
scanned setup/scripts, bin and the quickshell helpers, but never config/bash --
the one place in this repository whose entire job is to name tools and source
the files that provide them.

So it scans it now, and checks the shape rather than the instance: a literal
path sourced without testing it exists is a finding, wherever it appears. It
found the nvm line, and authselect behind the fingerprint aliases.

Node and pnpm move to nvm with it. They were declared as dnf packages while the
machine ran them from ~/.nvm, which is not a preference so much as a
contradiction -- a system Node earlier on PATH wins every `nvm use`, so the
per-project switching this shell config sets up could never have worked. nvm
install --lts, then pnpm inside it, so pnpm travels with the Node version it
belongs to instead of outliving it.

Claude-Session: https://claude.ai/code/session_01Q84axqUE5inJhf5Jz9CFy1
2026-08-21 00:30:48 -04:00

47 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# Editor used by CLI
export EDITOR="nvim"
export SUDO_EDITOR="$EDITOR"
export SSH_ASKPASS=/usr/bin/ksshaskpass
export SSH_ASKPASS_REQUIRE=prefer
# Define Paths
export CARGO_PATH="$HOME/.cargo"
export BUN_INSTALL="$HOME/.bun"
export PYENV_ROOT="$HOME/.pyenv"
export PNPM_HOME="$HOME/.local/share/pnpm"
export NVM_DIR="$HOME/.nvm"
export ANDROID_SDK_HOME="$HOME/.local/share/Android"
export GOPATH="$HOME/.local/share/go"
export DOTNETPATH="$HOME/.dotnet/tools"
# Podman
# export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
# Set complete path
export PATH="$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PANAMA_PATH/bin:$BUN_INSTALL/bin:$CARGO_PATH/bin:$PNPM_HOME/bin:$PYENV_ROOT/bin:$HOME/.rbenv/bin:/usr/lib/ccache/bin/:$GOPATH/bin:$DOTNETPATH"
# Nvm. Guarded because the file belongs to the nvm package: before that is
# installed it does not exist, and an unconditional source means every shell on
# a fresh machine opens with an error.
[ -f /etc/profile.d/nvm.sh ] && source /etc/profile.d/nvm.sh
# Auto-switch Node version when entering a directory with .nvmrc
_nvm_auto_use() {
if [[ -f .nvmrc ]]; then
nvm use --silent
fi
}
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_nvm_auto_use"
# Auto-start or attach tmux for SSH interactive shells
if [[ -n "$SSH_CONNECTION" && -z "$TMUX" && $- == *i* ]]; then
exec tmux new-session -A -s main
fi
# Zoxide
eval "$(zoxide init bash)"
# Oh My Posh
eval "$(oh-my-posh init bash --config $PANAMA_PATH/config/dot/ohmyposh/gib.omp.json)"