diff --git a/.devcontainer/.devcontainer.json b/.devcontainer/.devcontainer.json index 5732b4c..e29a98c 100644 --- a/.devcontainer/.devcontainer.json +++ b/.devcontainer/.devcontainer.json @@ -1,7 +1,5 @@ { "name": "Rust", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/rust:bullseye", "features": { "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {} }, @@ -17,5 +15,14 @@ "alexcvzz.vscode-sqlite" ] } + }, + "dockerFile": "Dockerfile", + "settings": { + "editor.formatOnSave": true, + "terminal.integrated.shell.linux": "/usr/bin/zsh", + "files.exclude": { + "**/CODE_OF_CONDUCT.md": true, + "**/LICENSE": true + } } } \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..2ebf715 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:18.04 + +WORKDIR /home/ + +COPY . . + +RUN bash ./setup.sh + +ENV PATH="/root/.cargo/bin:$PATH" \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000..f51e7aa --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,30 @@ +## update and install some things we should probably have +apt-get update +apt-get install -y \ + curl \ + git \ + gnupg2 \ + jq \ + sudo \ + zsh \ + vim \ + build-essential \ + openssl + +## 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 + +## setup and install oh-my-zsh +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +cp -R /root/.oh-my-zsh /home/$USERNAME +cp /root/.zshrc /home/$USERNAME +sed -i -e "s/\/root\/.oh-my-zsh/\/home\/$USERNAME\/.oh-my-zsh/g" /home/$USERNAME/.zshrc +chown -R $USER_UID:$USER_GID /home/$USERNAME/.oh-my-zsh /home/$USERNAME/.zshrc \ No newline at end of file