Skip to content

feat: make use of Nix files to set up dev env - #22

Merged
joyeecheung merged 12 commits into
mainfrom
nix-env
Jan 17, 2026
Merged

feat: make use of Nix files to set up dev env#22
joyeecheung merged 12 commits into
mainfrom
nix-env

Conversation

@aduh95

Copy link
Copy Markdown
Contributor

I first attempted to create the Docker image using Nix tools, but that ended up being too complicated, in the end it was easier to install Nix from the Dockerfile, and update the existing scripts to use Nix provided tools.

Worth noting the image contains a node built with all shared libs, similar to what builds test-shared GHA workflow on nodejs/node; we could certainly disable that to use the vendored static deps instead, the tradeoff being the build would take longer.

Fixes: #18

Comment threadDockerfile Outdated
Comment threadDockerfile Outdated
Comment threadscripts/build.sh
Comment threadDockerfile
@joyeecheung

Copy link
Copy Markdown
Member

Kicked off a build to see if the image built from this branch works https://github.com/joyeecheung/devcontainer/actions/runs/20376852332 (when it's done it'll be published to https://hub.docker.com/r/joyeecheung/node-devcontainer)

Comment threadDockerfile
Comment threadDockerfile Outdated
aduh95and others added 2 commits December 20, 2025 00:26
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Comment threadDockerfile Outdated
Comment threadDockerfile Outdated

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a suggestion on docs

Comment threadenvrc/README.md
Comment threadDockerfile
Comment threadDockerfile Outdated
Comment threadenvrc/README.md
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduh95

Copy link
Copy Markdown
ContributorAuthor

New test run: https://github.com/joyeecheung/devcontainer/actions/runs/20969928645

Looks like it built successfully, not sure how to test it further though

Comment threadDockerfile
# Setting up direnv for the local clone, see envrc/README.md for more info
COPY --chown=root:developer --chmod=0755 ./envrc/ /home/developer/envrc/
ARG IMAGE_VARIANT=static-libs
RUN cp "/home/developer/envrc/${IMAGE_VARIANT}.envrc" /home/developer/nodejs/node/.envrc

@joyeecheungjoyeecheungJan 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a try and I think this now needs an update in the devcontainer.json - at least, when paired with the default published image invariant (which uses static-lib). This is because devcontainers work by mounting the working dir, which overrides the .envrc copied within the container.

 "postStartCommand": "cp /home/developer/envrc/static-libs.envrc /home/developer/nodejs/node/.envrc && direnv allow /home/developer/nodejs/node"

If we add more published variant in the future, we can just add another devcontainer.json variant in the upstream that copy the corresponding envrc for a different paired image (e.g. "nodejs/devcontainer:shared-nightly" pairs with shared-libs.envrc, and then you can spin a devcontainer with a readily built shared lib configuration to test things)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung
joyeecheung merged commit ca4b8ad into mainJan 17, 2026
@joyeecheung
joyeecheung deleted the nix-env branch January 17, 2026 22:21
nodejs-github-bot pushed a commit to nodejs/node that referenced this pull request Jan 19, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Jan 20, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
islandryu pushed a commit to islandryu/node that referenced this pull request Jan 25, 2026
Refs: nodejs/devcontainer#22
PR-URL: nodejs#61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Jan 27, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 17, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 19, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 21, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 21, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 23, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
aduh95 pushed a commit to nodejs/node that referenced this pull request Feb 24, 2026
Refs: nodejs/devcontainer#22
PR-URL: #61414
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-use the Nix env that's being tested on nodejs/node

2 participants

@aduh95@joyeecheung