From 8cc23e70813e545c2e5866d0e01d276e5b987089 Mon Sep 17 00:00:00 2001 From: Yakiyo <91675932+Yakiyo@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:37:11 +0600 Subject: [PATCH 1/5] empty commit From 9c06afddd93f92624c8c9f849b85c9edf43e5809 Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Thu, 8 Jun 2023 21:42:24 +0600 Subject: [PATCH 2/5] feat: rename shell file to script - this allows users to use their own setup.sh files from their dotfiles repository --- .devcontainer/Dockerfile | 2 +- .devcontainer/{setup.sh => script.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .devcontainer/{setup.sh => script.sh} (100%) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3c6253d..9441f7c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,6 +4,6 @@ WORKDIR /home/ COPY . . -RUN bash ./setup.sh +RUN bash ./script.sh ENV PATH="/root/.cargo/bin:$PATH" diff --git a/.devcontainer/setup.sh b/.devcontainer/script.sh similarity index 100% rename from .devcontainer/setup.sh rename to .devcontainer/script.sh From a68727150662f151fe93b0ceff770a31dc3a7e4a Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Thu, 8 Jun 2023 21:47:44 +0600 Subject: [PATCH 3/5] fix: cargo and rustup invocations - install cargo plugins via cargo-binstall --- .devcontainer/script.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.devcontainer/script.sh b/.devcontainer/script.sh index 31ffb9c..501e7d7 100644 --- a/.devcontainer/script.sh +++ b/.devcontainer/script.sh @@ -13,14 +13,21 @@ apt-get install -y \ ## Install rustup and common components curl https://sh.rustup.rs -sSf | sh -s -- -y -rustup install nightly -rustup component add rustfmt -rustup component add rustfmt --toolchain nightly -rustup component add clippy -rustup component add clippy --toolchain nightly -cargo install cargo-expand -cargo install cargo-edit +# Path to rustup and cargo +RUSTUP="/root/.cargo/bin/rustup" +CARGO="/root/.cargo/bin/cargo" + +$RUSTUP install nightly +$RUSTUP component add rustfmt +$RUSTUP component add rustfmt --toolchain nightly +$RUSTUP component add clippy +$RUSTUP component add clippy --toolchain nightly + +# Download cargo-binstall to ~/.cargo/bin directory +curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + +$CARGO binstall cargo-expand cargo-edit -y ## setup and install oh-my-zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" From 90430e5d3b44b2c1c1a7d5d598b1cc33c991b5dd Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Thu, 8 Jun 2023 21:48:49 +0600 Subject: [PATCH 4/5] feat: use customizations/vscode for settings --- .devcontainer/devcontainer.json | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5352bae..05fe874 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,19 +1,23 @@ { "name": "Codespaces Rust Starter", - "extensions": [ - "cschleiden.vscode-github-actions", - "ms-vsliveshare.vsliveshare", - "matklad.rust-analyzer", - "serayuzgur.crates", - "vadimcn.vscode-lldb" - ], - "dockerFile": "Dockerfile", - "settings": { - "editor.formatOnSave": true, - "terminal.integrated.shell.linux": "/usr/bin/zsh", - "files.exclude": { - "**/CODE_OF_CONDUCT.md": true, - "**/LICENSE": true + "customizations": { + "vscode": { + "extensions": [ + "cschleiden.vscode-github-actions", + "ms-vsliveshare.vsliveshare", + "matklad.rust-analyzer", + "serayuzgur.crates", + "vadimcn.vscode-lldb" + ], + "settings": { + "editor.formatOnSave": true, + "terminal.integrated.shell.linux": "/usr/bin/zsh", + "files.exclude": { + "**/CODE_OF_CONDUCT.md": true, + "**/LICENSE": true + } + } } - } + }, + "dockerFile": "Dockerfile" } \ No newline at end of file From c66a22ab1e5eee2e041030baaa6551855eba263e Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Sun, 18 Jun 2023 10:29:50 +0600 Subject: [PATCH 5/5] fix: cargo rustup path --- .devcontainer/script.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.devcontainer/script.sh b/.devcontainer/script.sh index 501e7d7..fbe4451 100644 --- a/.devcontainer/script.sh +++ b/.devcontainer/script.sh @@ -14,20 +14,18 @@ apt-get install -y \ ## Install rustup and common components curl https://sh.rustup.rs -sSf | sh -s -- -y -# Path to rustup and cargo -RUSTUP="/root/.cargo/bin/rustup" -CARGO="/root/.cargo/bin/cargo" +export PATH="/root/.cargo/bin/":$PATH -$RUSTUP install nightly -$RUSTUP component add rustfmt -$RUSTUP component add rustfmt --toolchain nightly -$RUSTUP component add clippy -$RUSTUP component add clippy --toolchain nightly +rustup install nightly +rustup component add rustfmt +rustup component add rustfmt --toolchain nightly +rustup component add clippy +rustup component add clippy --toolchain nightly # Download cargo-binstall to ~/.cargo/bin directory curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash -$CARGO binstall cargo-expand cargo-edit -y +cargo binstall cargo-expand cargo-edit -y ## setup and install oh-my-zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"