Skip to content
Merged
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
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN mkdir -p $HOME/.vscode-server/data/Machine/ \
# FIXME: Consider moving this script into a Nix `writeShellApplication` trivial builder within the closure ...
# ... but that means I should figure it out how to pass to it $COMPILER_NIX_NAME as input?
RUN mkdir -p /usr/local/bin/ \
&& cat <<EOF >> /usr/local/bin/post-create-command
&& cat <<EOF >> /usr/local/bin/on-create-command
#!/usr/bin/env bash

PROJECT_DIR=\$(find /workspaces/ -mindepth 1 -maxdepth 1 -type d ! -name '.*' -print -quit)
Expand All @@ -53,7 +53,6 @@ if [ -n "\$PROJECT_DIR" ]; then
bash -ic "cabal update"
# GitHub Codespaces should have \$GITHUB_TOKEN already set.
if [ -n "\$GITHUB_TOKEN" ]; then
echo \$GITHUB_TOKEN | gh auth login --with-token
COMMIT_HASH=\$(git rev-parse HEAD)
echo "Attempting to download HLS cache from GitHub Artifact (cache-\$COMMIT_HASH-$COMPILER_NIX_NAME) for faster first launch ..."
gh run download -D .download -n "cache-\$COMMIT_HASH-$COMPILER_NIX_NAME"
Expand All @@ -65,4 +64,4 @@ if [ -n "\$PROJECT_DIR" ]; then
popd > /dev/null
fi
EOF
RUN chmod +x /usr/local/bin/post-create-command
RUN chmod +x /usr/local/bin/on-create-command
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ Refer to [`direnv` and `devx`](./docs/direnv.md) guide for more information.
## VSCode DevContainer / GitHub CodeSpace support

To make this developer shell available in VSCode DevContainer or GitHub CodeSpace, simply add a file named `.devcontainer/devcontainer.json` with the following content:
```json
```jsonc
{
"image":"ghcr.io/input-output-hk/devx-devcontainer:x86_64-linux.ghc96-iog",
"postCreateCommand": "post-create-command",
"onCreateCommand": "on-create-command",
"customizations":{
"vscode":{
"extensions":[
"haskell.haskell"
]
}
// Do not set custom `settings` as they would override devx-container defaults...
}
}
```
Expand Down Expand Up @@ -106,7 +107,7 @@ There are various flavors available as suffixes to the compiler names (e.g. `#gh

These can then be combined following this schema:
```
#ghc<ver>[-js|-windows|-static][-minimal][-iog]
#ghc<ver>[-js|-windows|-static][-minimal][-iog|-iog-full]
```
For example:
```bash
Expand Down