diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..f3d129f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,15 @@ +ARG VARIANT="buster" +FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT} + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive +RUN apt-get install libgtk-3-dev libssl-dev -y + +# generate completions +RUN su vscode -c 'mkdir ~/.zfunc' +RUN su vscode -c 'rustup completions zsh > ~/.zfunc/_rustup' +RUN su vscode -c 'rustup completions zsh cargo > ~/.zfunc/_cargo' + +# load completions via .zshrc +RUN su vscode -c 'echo fpath+=~/.zfunc >> ~/.zshrc' +RUN su vscode -c 'echo autoload -U compinit >> ~/.zshrc' +RUN su vscode -c 'echo compinit -i >> ~/.zshrc' diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8ec38f9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name": "rust", + "runArgs": [ + "--init", + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--userns=keep-id" + ], + "build": { + "dockerfile": "Dockerfile", + "args": { + "VARIANT": "buster" + } + }, + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", + "files.watcherExclude": { + "**/target/**": true + }, + "lldb.executable": "/usr/bin/lldb", + "rust-analyzer.checkOnSave.command": "clippy" + }, + "extensions": [ + "matklad.rust-analyzer", + "serayuzgur.crates", + "tamasfe.even-better-toml", + "vadimcn.vscode-lldb", + ], + "remoteUser": "vscode", + "containerUser": "vscode", + "workspaceMount": "src=${localWorkspaceFolder},dst=/workspace,type=bind,Z", + "workspaceFolder": "/workspace" +}