devshell icon indicating copy to clipboard operation
devshell copied to clipboard

WIP feat: add language.nodejs extra

Open tennox opened this issue 2 years ago • 1 comments

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 avatar Oct 18 '22 15:10 tennox

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

tennox avatar Oct 22 '22 22:10 tennox