From 049c8854a0a3068ecc7867f521d78b990ce2622c Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 10 Feb 2026 00:46:09 +0200 Subject: [PATCH] Use Rust via the rustup toolchain --- .config/setup/04-install-deb-packages.sh | 4 ---- .config/setup/06-install-rust-toolchain.sh | 11 +++++++++++ .local/bin/upgrade | 6 ++++++ .profile | 5 +++++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100755 .config/setup/06-install-rust-toolchain.sh diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index 70370d6..d443169 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -14,8 +14,6 @@ DEB_PKGS=( bluez borgbackup build-essential - cargo - cargo-doc catatonit curl direnv @@ -72,8 +70,6 @@ DEB_PKGS=( ripgrep rr rsync - rust-doc - rust-llvm shellcheck slurp speedtest-cli diff --git a/.config/setup/06-install-rust-toolchain.sh b/.config/setup/06-install-rust-toolchain.sh new file mode 100755 index 0000000..b837876 --- /dev/null +++ b/.config/setup/06-install-rust-toolchain.sh @@ -0,0 +1,11 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +tmpfile="$(mktemp)" +curl --fail --proto '=https' --show-error --silent --tlsv1.2 --output "${tmpfile}" https://sh.rustup.rs && \ + sh "${tmpfile}" --no-modify-path -y && \ + chmod o-rwx ~/.cargo/bin/* + rm "${tmpfile}" && \ + rustup component add llvm-tools diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 023622a..0859bed 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -14,6 +14,11 @@ emacs_update() { emacsclient --alternate-editor "" --reuse-frame --eval "(elpaca-pull-all t)" --no-wait > /dev/null } +rustup_update() { + echo Updating the rustup toolchain... + rustup update +} + cargo_update() { # shellcheck disable=SC2046 cargo install $(cargo install --list | grep '^[a-z0-9_-]\+ v[0-9.]\+:$' | cut --delimiter=' ' --fields=1) @@ -38,6 +43,7 @@ podman_update() { apt_update emacs_update +rustup_update uv_update cargo_update ghup diff --git a/.profile b/.profile index 1e7ee3e..694b3c4 100644 --- a/.profile +++ b/.profile @@ -21,6 +21,11 @@ if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi +# Hook up Rust +if [ -f "$HOME/.cargo/env" ]; then + . "$HOME/.cargo/env" +fi + if [ -d "$HOME/.cargo/bin" ] ; then PATH="$HOME/.cargo/bin:$PATH" fi