refactor(shell): replace version managers with mise activate

This commit is contained in:
2026-03-18 04:03:06 +02:00
parent cccb64a703
commit 2d316bfed7
16 changed files with 23 additions and 127 deletions

View File

@@ -18,7 +18,7 @@
[ -z "${EDITOR:-}" ] && export EDITOR="nvim"
[ -z "${VISUAL:-}" ] && export VISUAL="code"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
if ! command -v msg &> /dev/null; then
# Function to print messages if VERBOSE is enabled
@@ -334,10 +334,6 @@ export AWS_CONFIGURE_SESSION=true
export AWS_CONFIGURE_SESSION_DURATION=7200
export AWS_CONFIGURE_SESSION_MFA=true
# bob manages nvim versions
msg "Setting up bob configuration"
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
# Mason (nvim package manager)
msg "Setting up Mason configuration"
export MASON_HOME="$XDG_DATA_HOME/nvim/mason"
@@ -373,10 +369,6 @@ export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
export PATH="$COMPOSER_BIN:$PATH"
# NVM/Node
msg "Setting up NVM configuration"
export NVM_DIR="$XDG_DATA_HOME/nvm"
# Yarn
msg "Setting up Yarn configuration"
export YARN_GLOBAL_FOLDER="$XDG_DATA_HOME/yarn"
@@ -397,14 +389,6 @@ export DIRENV_LOG_FORMAT=""
export FZF_BASE="${XDG_CONFIG_HOME}/fzf"
export FZF_DEFAULT_OPTS='--height 40% --tmux bottom,40% --layout reverse --border top'
# FNM (Fast Node Manager)
msg "Setting up FNM configuration"
export FNM_DIR="$XDG_DATA_HOME/fnm"
export FNM_VERSION_FILE_STRATEGY="recursive"
export FNM_USE_ON_CD=true
export FNM_COREPACK_ENABLED=true
export FNM_RESOLVE_ENGINES=true
# GnuPG
# https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html
msg "Setting up GnuPG configuration"
@@ -419,13 +403,6 @@ export GOBIN="$XDG_BIN_HOME"
# Lando
export PATH="$HOME/.lando/bin${PATH+:$PATH}" #landopath
# NPM: Add npm packages to path
msg "Setting up NPM configuration"
x-have node && {
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
export PATH="$NVM_NODE_BIN_DIR:$PATH"
}
# oh-my-posh (omp) configuration
msg "Setting up oh-my-posh configuration"
export OHMYPOSH_CFG="$DOTFILES/config/omp/own.toml"
@@ -435,16 +412,10 @@ msg "Setting up 1Password CLI configuration"
export OP_CACHE="$XDG_STATE_HOME/1password"
# Python
#
# pyenv, python environments
msg "Setting up Python configuration"
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
## for MichaelAquilina/zsh-autoswitch-virtualenv
export AUTOSWITCH_VIRTUAL_ENV_DIR="$WORKON_HOME"
export PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
x-have pyenv && eval "$(pyenv init -)"
# Rust / cargo
msg "Setting up Rust/Cargo configuration"
@@ -514,14 +485,16 @@ export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history"
# Additional PATH entries (aligned with fish config)
[ -d "$XDG_DATA_HOME/mise/shims" ] && export PATH="$XDG_DATA_HOME/mise/shims:$PATH"
[ -d "$NVM_DIR/bin" ] && export PATH="$NVM_DIR/bin:$PATH"
[ -d "$YARN_GLOBAL_FOLDER/bin" ] && export PATH="$YARN_GLOBAL_FOLDER/bin:$PATH"
[ -d "$MASON_HOME/bin" ] && export PATH="$MASON_HOME/bin:$PATH"
[ -d "$HOME/.dotnet/tools" ] && export PATH="$HOME/.dotnet/tools:$PATH"
[ -d "$FNM_DIR" ] && export PATH="$FNM_DIR:$PATH"
[ -d "$POETRY_HOME/bin" ] && export PATH="$POETRY_HOME/bin:$PATH"
[ -d "$HOME/.opencode/bin" ] && export PATH="$HOME/.opencode/bin:$PATH"
# mise — unified tool version manager
# https://mise.jdx.dev
command -v mise &> /dev/null && eval "$(mise activate bash)"
if [ -f "$XDG_CONFIG_HOME/exports-secret" ]; then source "$XDG_CONFIG_HOME/exports-secret"; fi
if [ -f "$XDG_CONFIG_HOME/exports-local" ]; then source "$XDG_CONFIG_HOME/exports-local"; fi
# shellcheck source=./exports-lakka

View File

@@ -1 +0,0 @@
source "$HOME/.local/share/cargo/env.fish"

View File

@@ -22,20 +22,17 @@ if status is-interactive
type -q op; and test -e "$HOME/.config/op/plugins.sh" &&
source "$HOME/.config/op/plugins.sh"
# version manager initializers
type -q mise; and source (mise activate fish|psub)
type -q rbenv; and source (rbenv init -|psub)
type -q pyenv; and source (pyenv init -|psub)
type -q pyenv; and source (pyenv virtualenv-init -|psub)
type -q goenv; and source (goenv init -|psub)
# type -q fnm; and fnm env --use-on-cd --shell fish | source
type -q load_nvm; and load_nvm >/dev/stderr
# mise version manager
type -q mise; and mise activate fish | source
# Initialize other tools if available
type -q zoxide; and zoxide init fish | source
# Start tmux if not already running and not in SSH
#.t # defined in functions/.t.fish
else
# Non-interactive shells (IDE subprocesses) use shims for tool discovery
type -q mise; and mise activate fish --shims | source
end
# Added by LM Studio CLI (lms)

View File

@@ -23,11 +23,6 @@ fish_add_path "$XDG_DATA_HOME/mise/shims"
# Add cargo bin to path
fish_add_path "$XDG_DATA_HOME/cargo/bin"
# NPM/NVM configuration
set -q NVM_DIR; or set -x NVM_DIR "$XDG_DATA_HOME/nvm"
fish_add_path "$NVM_DIR/bin"
fish_add_path "$XDG_CONFIG_HOME/nvm"
# Yarn configuration
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
fish_add_path "$YARN_GLOBAL_FOLDER/bin"
@@ -93,14 +88,6 @@ x-dc "$DOCKER_CONFIG"
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
# FNM / Node.js configuration
set -q FNM_DIR; or set -x FNM_DIR "$XDG_DATA_HOME/fnm"
fish_add_path "$FNM_DIR"
set -q FNM_VERSION_FILE_STRATEGY; or set -x FNM_VERSION_FILE_STRATEGY recursive
set -q FNM_USE_ON_CD; or set -x FNM_USE_ON_CD true
set -q FNM_COREPACK_ENABLED; or set -x FNM_COREPACK_ENABLED true
set -q FNM_RESOLVE_ENGINES; or set -x FNM_RESOLVE_ENGINES true
# fzf configuration
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \
@@ -113,16 +100,11 @@ set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME"
set -q GOENV_ROOT; or set -x GOENV_ROOT "$XDG_DATA_HOME/goenv"
set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc.fish"
# 1Password configuration
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
# Python configuration
set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv"
fish_add_path "$PYENV_ROOT/bin"
# Poetry configuration
set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry"
@@ -134,7 +116,6 @@ set -q CARGO_BIN_HOME; or set -x CARGO_BIN_HOME "$XDG_BIN_HOME"
set -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup"
set -x RUST_WITHOUT "clippy,docs,rls"
fish_add_path "$CARGO_HOME/bin"
fish_add_path "$XDG_DATA_HOME/bob/nvim-bin"
# screen configuration
set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"

View File

@@ -1,16 +0,0 @@
function load_nvm --on-variable="PWD"
set -l default_node_version (nvm version default)
set -l node_version (nvm version)
set -l nvmrc_path (nvm_find_nvmrc)
if test -n "$nvmrc_path"
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
if test "$nvmrc_node_version" = N/A
nvm install (cat $nvmrc_path)
else if test "$nvmrc_node_version" != "$node_version"
nvm use $nvmrc_node_version
end
else if test "$node_version" != "$default_node_version"
echo "Reverting to default Node version"
nvm use default
end
end

View File

@@ -1,3 +0,0 @@
function nvm
bass source $NVM_DIR/nvm.sh --no-use ';' nvm $argv
end

View File

@@ -1,3 +0,0 @@
function nvm_find_nvmrc
bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc
end

View File

@@ -1,4 +1,2 @@
#!/usr/bin/env bash
[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.config/nvm"
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" # This loads nvm
eval "$(mise activate bash --shims)"

View File

@@ -27,8 +27,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-- ── Add ~/.local/bin to the PATH ────────────────────────────────────
vim.fn.setenv('PATH', vim.fn.expand '$HOME/.local/bin' .. ':' .. vim.fn.expand '$PATH')
-- ── Add mise shims and ~/.local/bin to the PATH ───────────────────────
vim.env.PATH = vim.env.HOME
.. '/.local/share/mise/shims:'
.. vim.env.HOME
.. '/.local/bin:'
.. vim.env.PATH
require 'options'
require 'autogroups'

View File

@@ -1,5 +0,0 @@
# $NVM_DIR/default-packages
yarn
neovim
corepack

View File

@@ -71,7 +71,6 @@ x-set-env XDG_BIN_HOME "$HOME/.local/bin"
x-path-prepend "/usr/local/bin"
x-path-prepend "/opt/homebrew/bin"
x-path-prepend "$XDG_DATA_HOME/cargo/bin"
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
x-path-prepend "$DOTFILES/local/bin"
x-path-prepend "$XDG_BIN_HOME"

View File

@@ -3,6 +3,9 @@
"
" vim: ts=2 sw=2 expandtab
" vint: +ProhibitAbbreviationOption +ProhibitSetNoCompatible
" mise — add shims to PATH for tool discovery
let $PATH = $HOME . '/.local/share/mise/shims:' . $PATH
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************

View File

@@ -18,7 +18,6 @@
# Plugin configurations
zstyle ':antidote:bundle' use-friendly-names 'yes'
zstyle ':omz:update' mode reminder
zstyle ':omz:plugins:nvm' autoload yes
# Pure prompt settings
export PURE_PROMPT_SYMBOL='➜'

View File

@@ -24,14 +24,10 @@ ohmyzsh/ohmyzsh path:plugins/fzf
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/golang
ohmyzsh/ohmyzsh path:plugins/gpg-agent
ohmyzsh/ohmyzsh path:plugins/nvm
ohmyzsh/ohmyzsh path:plugins/python
# ohmyzsh/ohmyzsh path:plugins/tmux
ohmyzsh/ohmyzsh path:plugins/z
# Automatically activate nvm if .nvmrc file is present
ivuorinen/nvm-auto-use
# Add core plugins that make Zsh a bit more like Fish
zdharma-continuum/fast-syntax-highlighting

View File

@@ -61,7 +61,7 @@
vcs # git status
# command_execution_time # previous command duration
go
nvm
mise
aws
# =========================[ Line #2 ]=========================
newline # \n
@@ -121,8 +121,8 @@
# Don't show context unless root or in SSH.
# typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
# aws, go and nvm versions colors.
typeset -g POWERLEVEL9K_{AWS,GO,NVM}_FOREGROUND=$grey
# aws, go and mise versions colors.
typeset -g POWERLEVEL9K_{AWS,GO,MISE}_FOREGROUND=$grey
# Show previous command duration only if it's >= 86400s = 24h.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=86400

View File

@@ -1,26 +0,0 @@
# shellcheck disable=SC1071,SC1103,SC2148
# Source: https://github.com/nvm-sh/nvm#zsh
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc