-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:jammy | ||
|
||
# These dependencies are required by Nix. | ||
RUN apt update -y | ||
RUN apt -y install --no-install-recommends curl xz-utils | ||
|
||
# Install Nix | ||
ARG NIX_INSTALL_SCRIPT=https://github.com/nix-community/nix-unstable-installer/releases/download/nix-2.23.0pre20240603_da92ad7/install | ||
RUN curl -L ${NIX_INSTALL_SCRIPT} | sudo -u vscode NIX_INSTALLER_NO_MODIFY_PROFILE=1 sh | ||
|
||
# Configuration for Nix from the repository shared amongst developers. | ||
RUN mkdir -p /etc/nix | ||
COPY .devcontainer/nix.conf /etc/nix/nix.conf | ||
# COPY nix.conf /etc/nix/nix.conf | ||
|
||
# This loads the development environment when the container is started. | ||
COPY .devcontainer/profile.sh /etc/profile.d/devcontainer.sh | ||
|
||
# COPY /home/vscode/.nix-profile/etc/profile.d/nix.sh /etc/profile.d/devcontainer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
// Options | ||
"NODE_VERSION": "none" | ||
} | ||
}, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// 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": "uname -a", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
"runArgs": ["--userns=keep-id"], | ||
"containerUser": "vscode", | ||
"updateRemoteUserUID": true, | ||
"containerEnv": { | ||
"HOME": "/home/vscode" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"github.vscode-github-actions", | ||
"GitHub.vscode-pull-request-github" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
experimental-features = nix-command flakes ca-references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
PROJECT_DIR=${PROJECT_DIR:-/workspace} | ||
|
||
# Make Nix available as it's not installed system-wide. | ||
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ] ; then | ||
. $HOME/.nix-profile/etc/profile.d/nix.sh | ||
fi | ||
|
||
# Only load the development environment if this is a login shell so calling a | ||
# shell later on doesn't reload the environment again. | ||
if shopt -q login_shell; then | ||
pushd "${PROJECT_DIR}" | ||
eval "$(nix print-dev-env --profile "${PROJECT_DIR}/.devcontainer/.profile")" | ||
popd | ||
fi |