diff --git a/rust-install.sh b/rust-install.sh new file mode 100644 index 0000000..b584b19 --- /dev/null +++ b/rust-install.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +echo "Init Rust..." + +echo export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static>>/etc/profile +echo export export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup>>/etc/profile +echo export CARGO_HTTP_MULTIPLEXING=false>>/etc/profile + +source /etc/profile + +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + +tee $HOME/cargo/config <<-'EOF' +[source.crates-io] +registry = "https://github.com/rust-lang/crates.io-index" +replace-with = 'ustc' +[source.ustc] +registry = "git://mirrors.ustc.edu.cn/crates.io-index" +#registry = "https://mirrors.ustc.edu.cn/crates.io-index" +EOF + +source $HOME/.cargo/env + +rustup -V + +rustup toolchain install nightly + +rustup -V \ No newline at end of file