Skip to content

Commit

Permalink
feat(base): configure direnv to autoapply for files under /workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Jul 19, 2024
1 parent dc53d78 commit 2af01cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
}
},
"extensions": [
"tamasfe.even-better-toml"
]
}
},
"updateContentCommand": "npm install -g @devcontainers/cli"
Expand Down
1 change: 1 addition & 0 deletions images/base/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ RUN { echo && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[0

COPY --chown=vscode:vscode bash_aliases .bash_aliases
COPY --chown=vscode:vscode gitconfig .config/git/config
COPY --chown=vscode:vscode direnv.toml .config/direnv/direnv.toml

# Custom PATH additions
ENV PATH=$HOME/.local/bin:$PATH
Expand Down
3 changes: 1 addition & 2 deletions images/base/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"shutdownAction": "stopContainer",
"remoteUser": "vscode",
"postCreateCommand": {
"docker-completion": "docker completion bash | sudo tee -a /etc/bash_completion.d/docker > /dev/null",
"direnv": "direnv allow || true"
"docker-completion": "docker completion bash | sudo tee -a /etc/bash_completion.d/docker > /dev/null"
}
}
6 changes: 6 additions & 0 deletions images/base/.devcontainer/direnv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Documentation
# @link https://direnv.net/man/direnv.toml.1.html

[whitelist]
# Automatically apply all .envrc files under /workspaces
prefix = ["/workspaces"]

0 comments on commit 2af01cc

Please sign in to comment.