Skip to content

Commit

Permalink
Update devcontainer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
scoiatael authored Jan 28, 2024
1 parent 44c82f4 commit f93d832
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
// Source: https://github.com/NixOS/nix/issues/6680#issuecomment-1577781769
{
"image":"mcr.microsoft.com/devcontainers/base:alpine",
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"features": {
"ghcr.io/devcontainers/features/nix:1": {
"multiUser": true,
"version": "latest"
"version": "latest",
// Needed for flakes & nix-direnv:
"extraNixConfig": "experimental-features = nix-command flakes,keep-outputs = true,keep-derivations = true"
}
},
"onCreateCommand": {
// Set up global gitignore for direnv.
// "init-git": "mkdir -p ~/.config/git && printf '.direnv/\\n.envrc\\n' > ~/.config/git/ignore && git config --global core.excludesfile ~/.config/git/ignore",
// Install, set up and allow direnv in workspace.
"install-direnv": "nix profile install nixpkgs#direnv nixpkgs#nix-direnv && mkdir -p ~/.config/direnv && echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' >> ~/.config/direnv/direnvrc && cp .envrc.recommended .envrc && direnv allow && echo 'eval \"$(direnv hook bash)\"' >> ~/.bashrc",
// Run `print-dev-env` to build `devShells.${system}.default`.
"build-dev-env": "nix print-dev-env"
},
"customizations": {
"vscode": {
"extensions": [
// Inject direnv variables into VS Code terminals and tasks:
"mkhl.direnv",
// Support for `.nix` files:
"jnoortheen.nix-ide"
]
}
}
}

0 comments on commit f93d832

Please sign in to comment.