From 9ece01a77e263f20cff117c93b152dab351b718c Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 9 May 2024 02:24:22 +0100 Subject: [PATCH] feat(tools): install Rust-based CLI tools with mise Use `mise` to install and manage tools normally installed with `cargo install`. --- config/mise/config.toml | 16 ++++++++++++++++ config/mise/settings.toml | 1 + zsh/rust.zsh | 34 ++-------------------------------- zshenv | 2 ++ 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/config/mise/config.toml b/config/mise/config.toml index 23510a4..7c2c720 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -1,4 +1,20 @@ [tools] +"cargo:bacon" = "latest" +"cargo:bat" = "latest" +"cargo:cargo-audit" = "latest" +"cargo:cargo-binstall" = "latest" +"cargo:cargo-edit" = "latest" +"cargo:cargo-info" = "latest" +"cargo:cargo-quickinstall" = "latest" +"cargo:cargo-update" = "latest" +"cargo:difftastic" = "latest" +"cargo:dirstat-rs" = "latest" +"cargo:eza" = "latest" +"cargo:gitu" = "0.19" +"cargo:hexyl" = "latest" +"cargo:jwt-cli" = "latest" +"cargo:sccache" = "latest" +"cargo:tlrc" = "latest" "go:github.com/bufbuild/buf-language-server/cmd/bufls" = "latest" "go:github.com/go-delve/delve/cmd/dlv" = "latest" "go:github.com/golang/mock/mockgen" = "latest" diff --git a/config/mise/settings.toml b/config/mise/settings.toml index cf187f8..9d6342b 100644 --- a/config/mise/settings.toml +++ b/config/mise/settings.toml @@ -1,2 +1,3 @@ +cargo_binstall = true experimental = true legacy_version_file = true diff --git a/zsh/rust.zsh b/zsh/rust.zsh index b04f42e..9d24a67 100644 --- a/zsh/rust.zsh +++ b/zsh/rust.zsh @@ -8,8 +8,8 @@ alias c="cargo" -if command-exists exa; then - alias ll="exa -lagHS --color-scale --icons --git" +if command-exists eza; then + alias ll="eza -lagHS --icons --git" alias llt="ll --tree" fi @@ -53,35 +53,5 @@ install_rust_global_packages() { rust-analyzer \ rust-src \ rustfmt - - # Install or update cargo-binstall - if ! command-exists cargo-binstall; then - RUSTC_WRAPPER="${commands[sccache]}" cargo install cargo-binstall - fi - - # Install sccache before the rest of the packages. - if ! command-exists sccache; then - RUSTC_WRAPPER="" cargo binstall sccache - fi - - if ! command-exists cargo-quickinstall; then - RUSTC_WRAPPER=sccache cargo binstall cargo-quickinstall - fi - - RUSTC_WRAPPER=sccache cargo quickinstall \ - cargo-audit \ - cargo-info - - RUSTC_WRAPPER=sccache cargo binstall -y \ - bacon \ - bat \ - cargo-edit \ - cargo-update \ - difftastic \ - dirstat-rs \ - exa \ - gitu \ - hexyl \ - jwt-cli ) } diff --git a/zshenv b/zshenv index 874fb95..42e9183 100644 --- a/zshenv +++ b/zshenv @@ -224,6 +224,8 @@ path_prepend "$CARGO_HOME/bin" export RUST_BACKTRACE=1 if command-exists sccache; then export RUSTC_WRAPPER=sccache +else + export RUSTC_WRAPPER="" fi # mise setup