numtide / devshell

Per project developer environments
https://numtide.github.io/devshell/
MIT License
1.22k stars 87 forks source link

WIP feat: add language.nodejs extra #233

Open tennox opened 1 year ago

tennox commented 1 year ago

I'm new to nix but managed to throw together what I needed to have consistent nodejs version for:

node --version
yarn node --version
pnpm node --version

Usage:

imports = ["language/nodejs"]

[language.nodejs]
package = "nodejs-16_x"

I think in the end it might be better or more DRY to use something like: https://github.com/cprussin/nixjs

But it's a bit outdated and I did not figure out how to define overlays in an extra file. :cry: (I still would love to know)

tennox commented 1 year ago

I figured out now that most of the custom patches are not necessary if you just overlay the default nodejs package:

overlays = [ (self: prevPkgs: {
    nodejs = prevPkgs.nodejs-16_x;
}) ]

So if we can add an overlay in an extra file that would be the the simplest solution :thinking:

see also in the discourse