From b2e491b23ba1c76a447a40957e3225da9fc45214 Mon Sep 17 00:00:00 2001 From: Martin Matyasek Date: Sun, 10 Apr 2022 21:10:49 +0200 Subject: [PATCH] Move rust tools to XDG_DATA_HOME Addresses https://github.com/matyama/configs/issues/17 - Adds `RUSTUP_HOME` and `CARGO_HOME` pointing to `XDG_DATA_HOME` - Note: out-of-the-box support is still an open issue for both `rustup` and `cargo` After reloading the shell (i.e. if both env vars are in scope), one can just move/rename `~/.rustup` and `~/.cargo` to appropriate dirs in `XDG_DATA_HOME`. --- .zshenv | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.zshenv b/.zshenv index 0089ee6..0b0a591 100644 --- a/.zshenv +++ b/.zshenv @@ -35,8 +35,14 @@ export BINENV_HOME=${HOME}/.binenv # Poetry export POETRY_BIN=${HOME}/.poetry/bin -# Rust stuff -export CARGO_BIN=${HOME}/.cargo/bin +# Rust +# - Note: Out-of-the-box XDG support is still an open issue for both `rustup` +# and `cargo`, monitor. +# - https://github.com/rust-lang/rustup/issues/247 +# - https://github.com/rust-lang/cargo/issues/1734 +export RUSTUP_HOME=${XDG_DATA_HOME}/rustup +export CARGO_HOME=${XDG_DATA_HOME}/cargo +export CARGO_BIN=${CARGO_HOME}/bin export CARGO_INCREMENTAL=1 export RUSTFLAGS="-C target-cpu=native" export RUST_BACKTRACE=1