Skip to content

Commit

Permalink
Add codespace config
Browse files Browse the repository at this point in the history
  • Loading branch information
max-lt committed Feb 24, 2024
1 parent 2adc294 commit d19fca1
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:18.04

WORKDIR /home/

COPY . .

RUN bash ./setup.sh

ENV PATH="/root/.cargo/bin:$PATH"
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Codespaces For OpenWorkers Dev Container",
"dockerFile": "Dockerfile",
"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
}
}
}
}
}
32 changes: 32 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

## 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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"actix",
"codespaces",
"customizer",
"deno",
"hrtime",
Expand Down

0 comments on commit d19fca1

Please sign in to comment.