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 ec88f3f commit 4f2b38d
Show file tree
Hide file tree
Showing 4 changed files with 26 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"
}
}
20 changes: 20 additions & 0 deletions images/base/.devcontainer/direnv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2023 Simon Emms <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Documentation
# @link https://direnv.net/man/direnv.toml.1.html

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

0 comments on commit 4f2b38d

Please sign in to comment.