feat(tools): install Rust-based CLI tools with mise

Use `mise` to install and manage tools normally installed with
`cargo install`.
This commit is contained in:
2024-05-09 02:24:22 +01:00
parent 2cbd074bac
commit 9ece01a77e
4 changed files with 21 additions and 32 deletions

View File

@@ -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"

View File

@@ -1,2 +1,3 @@
cargo_binstall = true
experimental = true
legacy_version_file = true

View File

@@ -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
)
}

2
zshenv
View File

@@ -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