Migrate to mise from asdf

main
Ensar Sarajčić 2024-11-21 17:59:33 +01:00
parent 566b391dcc
commit 85964e068f
14 changed files with 38 additions and 88 deletions

View File

@ -117,7 +117,7 @@ bootstrap_mac: check_os link bootstrap_common oh_my_zsh homebrew install_brew_ba
@echo "Bootstrapped mac components!" @echo "Bootstrapped mac components!"
.PHONY: bootstrap_common .PHONY: bootstrap_common
bootstrap_common: check_os link_all_common prepare_projects_dir prepare_screenshots_dir prepare_scripts_cache_dir install_vim install_asdf alacritty_terminfo bootstrap_common: check_os link_all_common prepare_projects_dir prepare_screenshots_dir prepare_scripts_cache_dir install_vim install_mise alacritty_terminfo
@echo "Bootstrapped common components!" @echo "Bootstrapped common components!"
.PHONY: link .PHONY: link
@ -183,9 +183,9 @@ link_script_utils: check_os
.PHONY: link_tool_versions .PHONY: link_tool_versions
link_tool_versions: check_os link_tool_versions: check_os
@echo "Linking tool-versions file for asdf" @echo "Linking tool-versions file for mise"
$(call link,tool-versions,.tool-versions) $(call link,tool-versions,.tool-versions)
$(call link,config/asdf/.default-gems,.default-gems) $(call link,config/mise/.default-gems,.default-gems)
.PHONY: link_profile .PHONY: link_profile
link_profile: check_os link_profile: check_os
@ -286,42 +286,13 @@ install_brew_basics: homebrew check_os
@echo "Installig basic brew packages..." @echo "Installig basic brew packages..."
@brew bundle --file $(DOTFILES_DIR)/installed_packages/core/Brewfile @brew bundle --file $(DOTFILES_DIR)/installed_packages/core/Brewfile
.PHONY: install_asdf .PHONY: install_mise
install_asdf: check_os install_mise: check_os
@echo "Installing ASDF VM..." @echo "Installing mise..."
@git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.0 @curl https://mise.run | sh
@echo "Installed ASDF Version 0.10.0" @mise direnv activate > ~/.config/direnv/lib/use_mise.sh
@echo "To install latest version:"
@echo ""
@echo "cd ~/.asdf"
@echo "git fetch"
@echo "git checkout \"$$\(git describe --abbrev=0 --tags\)\""
@echo ""
@echo "Consider installing configured ASDF tools:"
@echo ""
@echo ""
@echo "Run in home directory:"
@echo "asdf install"
@echo ""
@echo ""
@echo "Consider installing ASDF plugins:"
@echo "=================================="
@echo "DIRENV:"
@echo "----------------------------------"
@echo "asdf plugin-add direnv"
@echo "asdf install direnv latest"
@echo ""
@echo "Check out installed version using: "
@echo "asdf list direnv"
@echo ""
@echo "Configure it as global using: "
@echo "asdf global direnv $$version"
@echo ""
@echo "Configure it with provided function:"
@echo "asdf direnv setup --shell fish --version latest"
@echo ""
@echo "When using in projects, put the following in .envrc: " @echo "When using in projects, put the following in .envrc: "
@echo "use asdf" @echo "use mise"
@echo "==================================" @echo "=================================="
@echo "" @echo ""

View File

@ -18,8 +18,8 @@ if test -S $SERVER_NAME; then
/usr/bin/wmctrl -a "$WINDOW_NAME" /usr/bin/wmctrl -a "$WINDOW_NAME"
fi fi
fi fi
~/.asdf/shims/nvim --server $SERVER_NAME --remote $2 ~/.local/share/mise/shims/nvim --server $SERVER_NAME --remote $2
~/.asdf/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)<CR>" ~/.local/share/mise/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)<CR>"
else else
/usr/bin/alacritty --title "$WINDOW_NAME" -e /usr/bin/fish -c "nvim --listen $SERVER_NAME $2 --cmd \"call cursor($LINE, $COLUMN)\"" /usr/bin/alacritty --title "$WINDOW_NAME" -e /usr/bin/fish -c "nvim --listen $SERVER_NAME $2 --cmd \"call cursor($LINE, $COLUMN)\""
fi fi

View File

@ -71,23 +71,9 @@ then
command vim +PlugUpdate +qall command vim +PlugUpdate +qall
fi fi
if [ "${RUN[asdf]}" = "1" ] if [ "${RUN[mise]}" = "1" ]
then then
asdf update mise self-update
asdf plugin-update --all
echo "========== ASDF UPDATES =========="
echo "Available updates: "
while IFS= read -r PKG; do
if [ $(echo "$PKG" | cut -f3) = "missing" ]; then
PKG_NAME=$(echo $PKG | cut -f1 -d " ")
if [ "$PKG_NAME" != "java" -a "$PKG_NAME" != "ruby" ]; then
PKG_VER=$(echo $PKG | cut -f2 -d " ")
echo " $PKG_NAME - $PKG_VER (install with 'asdf install $PKG_NAME $PKG_VER' and set as global default with 'asdf global $PKG_NAME $PKG_VER')"
fi
fi
done <<< "$(asdf latest --all)"
echo "========== ASDF UPDATES =========="
fi fi
if [ "${RUN[brew]}" = "1" ] if [ "${RUN[brew]}" = "1" ]

View File

@ -1 +1,2 @@
[general]
import = ["~/.config/alacritty/font.toml", "~/.config/alacritty/colors.toml", "~/.config/alacritty/keymap.toml"] import = ["~/.config/alacritty/font.toml", "~/.config/alacritty/colors.toml", "~/.config/alacritty/keymap.toml"]

View File

@ -0,0 +1,12 @@
# if "usage" is not installed show an error
if ! command -v usage &> /dev/null
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mise." >&2
echo "See https://usage.jdx.dev for more information." >&2
return 1
end
if ! set -q _usage_spec_mise_2024_11_13
set -g _usage_spec_mise_2024_11_13 (mise usage | string collect)
end
complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2024_11_13" -- (commandline -cop) (commandline -t))'

View File

@ -2,7 +2,7 @@ fenv source ~/.profile
set -g fish_prompt_pwd_dir_length 0 set -g fish_prompt_pwd_dir_length 0
set -gx PROJECT_PATHS ~/Projects/*/* ~/Projects/Personal/Mixed\ Technology/Practice set -gx PROJECT_PATHS ~/Projects/*/* ~/Projects/Personal/Mixed\ Technology/Practice
set -gx ASDF_PYTHON_DEFAULT_PACKAGES_FILE ~/.config/asdf/.python-default-packages set -gx MISE_PYTHON_DEFAULT_PACKAGES_FILE ~/.config/asdf/.python-default-packages
set -gx FZF_DEFAULT_COMMAND 'rg --files' set -gx FZF_DEFAULT_COMMAND 'rg --files'
if which termux-info &> /dev/null if which termux-info &> /dev/null
@ -29,27 +29,8 @@ abbr -a gcm "git checkout (__git.default_branch)"
source ~/.config/fish/platform_config/$MACHINE_TYPE.fish source ~/.config/fish/platform_config/$MACHINE_TYPE.fish
if [ -f /opt/asdf-vm/asdf.sh ] if status is-interactive
set -gx ASDF_DIR /opt/asdf-vm mise activate fish | source
set -gx ASDF_CONFIG_FILE $XDG_CONFIG_HOME/asdf/asdfrc
set -gx ASDF_DATA_DIR $XDG_DATA_HOME/asdf
source $ASDF_DIR/asdf.sh
else else
source ~/.asdf/asdf.fish mise activate fish --shims | source
if [ -f ~/.asdf/plugins/dotnet-core/set-dotnet-home.fish ]
. ~/.asdf/plugins/dotnet-core/set-dotnet-home.fish
end
end
eval (asdf exec direnv hook fish | source)
function direnv
asdf exec direnv "$argv"
end
function asdfexec
begin
asdf shell $argv[1] $argv[2]
$argv[3..]
end
end end

View File

@ -3,8 +3,8 @@
" Explicit declaration of python host program to "prevent suprises" " Explicit declaration of python host program to "prevent suprises"
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
if !has('win32') if !has('win32')
let g:python_host_prog = $HOME.'/.asdf/shims/python2' let g:python_host_prog = $HOME.'/.local/share/mise/shims/python2'
let g:python3_host_prog = $HOME.'/.asdf/shims/python3' let g:python3_host_prog = $HOME.'/.local/share/mise/shims/python3'
else else
let g:python_host_prog = $HOME.'/scoop/shims/python2' let g:python_host_prog = $HOME.'/scoop/shims/python2'
let g:python3_host_prog = $HOME.'/scoop/shims/python3' let g:python3_host_prog = $HOME.'/scoop/shims/python3'

View File

@ -82,7 +82,7 @@ end
-- Flutter tools -- Flutter tools
require("flutter-tools").setup({ require("flutter-tools").setup({
lsp = common_config, lsp = common_config,
flutter_lookup_cmd = "asdf where flutter", flutter_lookup_cmd = "mise where flutter",
}) })
-- Rust tools -- Rust tools

View File

@ -2,7 +2,7 @@
" - Neovim ruby host - " - Neovim ruby host -
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
if !has('win32') if !has('win32')
let g:ruby_host_prog = '~/.asdf/shims/ruby' let g:ruby_host_prog = '~/.local/share/mise/shims/ruby'
else else
let g:ruby_host_prog = '~/scoop/shims/ruby' let g:ruby_host_prog = '~/scoop/shims/ruby'
endif endif

View File

@ -3,7 +3,7 @@ Description=Rust analyzer multiplex server
[Service] [Service]
Type=simple Type=simple
ExecStart=%h/.asdf/shims/ra-multiplex server ExecStart=%h/.cargo/bin/ra-multiplex server
[Install] [Install]
WantedBy=default.target WantedBy=default.target

View File

@ -57,6 +57,7 @@ tags
# ASDF # ASDF
.tool-versions .tool-versions
mise.local.toml
# Idea # Idea
.idea .idea

View File

@ -21,7 +21,7 @@ done
declare -A RUN=() declare -A RUN=()
for command in "pacman" "apt" "dnf" "flatpak" "gem" "nvim" "asdf" "brew" "pacman" "pip" "pip2" "pip3"; for command in "pacman" "apt" "dnf" "flatpak" "gem" "nvim" "mise" "brew" "pacman" "pip" "pip2" "pip3";
do do
if type $command > /dev/null 2>&1 if type $command > /dev/null 2>&1
then then

View File

@ -46,7 +46,7 @@ ZSH_THEME="agnoster"
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=(git mix asdf) plugins=(git mix)
# User configuration # User configuration

View File

@ -35,8 +35,6 @@ if [ -f "$HOME/.zshrc.local" ]; then
source $HOME/.zshrc.local source $HOME/.zshrc.local
fi fi
source /usr/local/opt/asdf/asdf.sh
# Print update date # Print update date
print-last-brew-update print-last-brew-update