devshell
devshell copied to clipboard
WIP feat: add language.nodejs extra
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)
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: