devcontainer icon indicating copy to clipboard operation
devcontainer copied to clipboard

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

Open aduh95 opened this issue 3 months ago • 2 comments

There's a Nix integration on nodejs/node that's tested on every commit, we could take advantage of it instead of maintaining a separate dev env. By its nature of being declarative and claiming 100% reproducibility, both Nix and devcontainer are tools that can be used to provide a "blessed" dev env, so let's try to make them converge to a single one.

That could open the door to using the build artifacts from this repo to speed up the linux builds on nodejs/node.

The idea comes from the discussion with @joyeecheung in https://github.com/nodejs/node/pull/60472#discussion_r2471355819.

aduh95 avatar Oct 29 '25 18:10 aduh95

Not opposed to convergence. I'm curious what the goals of the Nix environment are and what your thoughts on how merging them would be implemented?

bnb avatar Oct 29 '25 23:10 bnb

The goal of Nix (as a language / package manager) is to be able to fully define how to build something declaratively. My original goal at first was simply to use it for myself, which I did, but as I was trying to make my builds faster using shared libs, I realized some were broken, probably for years. So long story shorts, once the patches have been merged, I opened a PR to add my Nix setup to the repo, and a GHA workflow to ensure it doesn't break again without anyone noticing.

But whatever the original goals, we now have an environment fully described by the Nix files I added that's guaranteed to be able to build node, so it's up to us to take advantage of it or not. Regarding how to merge the two, maybe I'm overlooking some obvious difficulties, but it might be as simple as port the Dockerfile to Nix, as advertized in https://nixos.org/#asciinema-demo-example_4.

aduh95 avatar Oct 29 '25 23:10 aduh95