From e2594c49f604d3cb06403fb58bb094ed93ae992f Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Tue, 12 Feb 2019 22:32:00 +0100 Subject: [PATCH] Make rust use XDG directories Signed-off-by: Severin Kaderli --- post-install.sh | 12 +++++++++++- system/.env | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/post-install.sh b/post-install.sh index 1c59b3f..808f464 100755 --- a/post-install.sh +++ b/post-install.sh @@ -26,8 +26,18 @@ NPM_PACKAGES=( "npm-check-updates" ) +RUST_COMPONENTS=( + "rls-preview" + "rustfmt-preview" +) + ####################################### # Main code ####################################### print_header "Installing global npm packages" -npm i -g "${NPM_PACKAGES[@]}" \ No newline at end of file +npm i -g "${NPM_PACKAGES[@]}" + +print_header "Install Rust toolchain and components" +rustup toolchain install beta +rustup default beta +rustup component add "${RUST_COMPONENTS[@]}" \ No newline at end of file diff --git a/system/.env b/system/.env index 6839c1d..d6a0656 100644 --- a/system/.env +++ b/system/.env @@ -23,13 +23,15 @@ export HTTPIE_CONFIG_DIR="${XDG_CONFIG_HOME}/httpie" export XAUTHORITY="${XDG_RUNTIME_DIR}/Xauthority" export WGETRC="${XDG_CONFIG_HOME}/wget/wgetrc" export VIMINIT=":source ${XDG_CONFIG_HOME}/vim/vimrc" +export CARGO_HOME="${XDG_DATA_HOME}/cargo" +export RUSTUP_HOME="${XDG_DATA_HOME}/rustup" # Bash export HISTCONTROL=ignoreboth export HISTSIZE=1000 export HISTFILESIZE=2000 -# Setting default editor and terminal +# Setting applications export VISUAL=vim export EDITOR="$VISUAL" export TERMINAL=termite @@ -50,7 +52,7 @@ export npm_config_prefix="$HOME/.node_modules" export GOPATH=$HOME/go # Adding folders to the PATH variable -export PATH="$PATH:$HOME/bin:$npm_config_prefix/bin:$GOPATH/bin:$HOME/.config/composer/vendor/bin" +export PATH="${PATH}:${CARGO_HOME}/bin:${HOME}/bin:${npm_config_prefix}/bin:${GOPATH/}bin:${HOME}/.config/composer/vendor/bin" # Set bash prompt set_bash_prompt() {