Skip to content

Commit

Permalink
Move rust tools to XDG_DATA_HOME
Browse files Browse the repository at this point in the history
Addresses #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`.
  • Loading branch information
matyama committed Apr 10, 2022
1 parent 555be39 commit b2e491b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2e491b

Please sign in to comment.