Node2nix 1.7.0 released

Hi everybody! Today, I released node2nix 1.7.0. This release contains the following changes:

  • node2nix uses Node.js 8.x by default, which is the oldest, still supported LTS release
  • added first class Nix generation support for Node.js 12.x via the --nodejs-12 option. Node.js 12.x will become the new LTS release in the future.
  • fixed deploying Git dependencies from package-lock.json files with recent versions of NPM 6.x
  • added preliminary Git sub module support.
  • added a workaround for deploying NPM dependencies from the NPM registry with a package-lock.json file. By normal means, such tarballs can’t be published, but some devs using unconventional publishing methods, for strange reasons still can.
  • the untarring step uses --delay-directory-restore to work around tarballs with wrong permissions created on Windows machines.
  • node2nix now checks for the presence of the name and version attributes in package.json files. These attributes are mandatory, but previously, there was no way you will get warned until the generation itself fails.

I also updated the master branch of Nixpkgs with expressions generated by node2nix 1.7.0.

Furthermore, I introduced a new package attribute set: nodePackages_12_x in Nixpkgs that can be used to automatically deploy packages for Node.js 12.x installations. It should still be used with caution since Node.js 12.x has not received any LTS status yet.

10 Likes

Thanks for node2nix. I use it frequently and it works very well :slight_smile:

Hi, newbie on NixOS here.

How do I upgrade to this version? Doing nix-env -qa -A "nixos.nodePackages.node2nix" only lists the 1.6 version.

I know this is ‘how to use Nix’ question but, please, point me in right direction.

Thanks, Joe.

1 Like

I think you’re probably using an older version of Nixpkgs.

If you are using the default installation, then you should probably run: nix-channel --update
If you ware using a Nixpkgs git clone, then you should pull the latest (or a considerably) newer revision.

Thank you Sander. I needed to add the channel nixpkgs-unstable to get latest release.