Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nix based devcontainer #3097

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/xtruder/nix-devcontainer:latest
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-existing-dockerfile
{
"name": "noir-lang-project",
"dockerFile": "Dockerfile",
// "context": "${localWorkspaceFolder}",
"build": {
"args": {
"USER_UID": "${localEnv:USER_UID}",
"USER_GID": "${localEnv:USER_GID}"
},
},

// run arguments passed to docker
"runArgs": [
"--security-opt", "label=disable"
],

"containerEnv": {
// extensions to preload before other extensions
"PRELOAD_EXTENSIONS": "arrterian.nix-env-selector"
},

// disable command overriding and updating remote user ID
"overrideCommand": false,
"userEnvProbe": "loginShell",
"updateRemoteUserUID": false,

// build development environment on creation
// this will build all dependencies, incl. ones from flake.
// Comment this if desirable
// "onCreateCommand": "nix-shell --command 'echo done building nix dev environment'",

// Add the IDs of extensions you want installed when the container is created.
"customizations": {
"vscode": {
"extensions": [
"arrterian.nix-env-selector",
"bbenoist.Nix"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": []

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "cargo --version",

}