diff --git a/.Brewfile b/.Brewfile index 031b9b8..156744d 100644 --- a/.Brewfile +++ b/.Brewfile @@ -11,4 +11,5 @@ brew "wget" brew "cockroachdb/tap/cockroach" brew "mongodb/brew/mongodb-database-tools" brew "supabase/tap/supabase" +brew "mise" cask "codex" diff --git a/.zprofile b/.zprofile index 461423b..f5596fe 100644 --- a/.zprofile +++ b/.zprofile @@ -33,11 +33,10 @@ fi # Android tools export PATH=$PATH:"$HOME/Android/Sdk/platform-tools" -# asdf completion -# https://asdf-vm.com/guide/getting-started.html -if [[ -s $HOME/.asdf/asdf.sh ]]; then - . "$HOME/.asdf/asdf.sh" - fpath=(${ASDF_DIR}/completions $fpath) +# mise (shims for non-interactive shells and IDEs) +# https://mise.jdx.dev/dev-tools/shims.html +if command -v mise &> /dev/null; then + eval "$(mise activate zsh --shims)" fi if [[ -f /opt/homebrew/bin/brew ]]; then diff --git a/.zshrc b/.zshrc index 0834dcb..ec9459c 100644 --- a/.zshrc +++ b/.zshrc @@ -108,17 +108,12 @@ fi # Pulumi completion [ $commands[pulumi] ] && source <(pulumi gen-completion zsh) -# JAVA_HOME (asdf) -[ -s ~/.asdf/plugins/java/set-java-home.zsh ] && . ~/.asdf/plugins/java/set-java-home.zsh - -# FLUTTER_ROOT (asdf) -[[ $(asdf where flutter 2> /dev/null) ]] && export FLUTTER_ROOT="$(asdf where flutter)" - -# AWS CLI completion (asdf) -[ -s $HOME/.asdf/shims/aws_completer ] && complete -C '$HOME/.asdf/shims/aws_completer' aws - -# Terraform completion (asdf) -[ -s $HOME/.asdf/shims/terraform ] && complete -o nospace -C "$HOME/.asdf/shims/terraform" terraform +# mise (Linux only; Homebrew auto-activates on macOS) +# https://mise.jdx.dev/ +if [[ "$(uname)" == "Linux" ]] && command -v mise &> /dev/null; then + eval "$(mise activate zsh)" + eval "$(mise completion zsh)" +fi # Azure CLI completion if [[ -f "$HOME/.azure/az.completion" ]] then; diff --git a/bootstrap/asdf.sh b/bootstrap/asdf.sh deleted file mode 100755 index d1eba47..0000000 --- a/bootstrap/asdf.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# asdf -# https://asdf-vm.com/ - -if [ -d "${HOME}/.asdf" ]; then - echo asdf is already installed. - exit 0 -fi - -echo Install asdf. - -git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 - -exit 0 diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh index 7b2216a..99d5a92 100755 --- a/bootstrap/bootstrap.sh +++ b/bootstrap/bootstrap.sh @@ -32,8 +32,8 @@ fi task "Install prezto" "prezto.sh" task "Install Tmux Plugin Manager" "tpm.sh" task "Install fzf" "fzf.sh" -task "Install asdf" "asdf.sh" task "Install rulesync" "rulesync.sh" +task "Setup mise" "mise.sh" if [ "$(uname)" == "Linux" ]; then task "Install Docker" "docker.sh" diff --git a/bootstrap/mise.sh b/bootstrap/mise.sh new file mode 100755 index 0000000..f577411 --- /dev/null +++ b/bootstrap/mise.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +# https://mise.jdx.dev/installing-mise.html + +# Install (Linux only) +if [ "$(uname)" == "Linux" ] && ! command -v mise &> /dev/null; then + sudo install -dm 755 /etc/apt/keyrings + wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null + echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list + sudo apt-get -y update + sudo apt-get -y install mise +fi + +# Configure +mise settings set idiomatic_version_file_enable_tools '["node"]' + +exit 0