npm2nix
npm2nix copied to clipboard
Generates incorrect default.nix for iojs
When using iojs the generated default.nix should be slightly different, for example:
{ foo ? { outPath = ./.; name = "foo"; }
, pkgs ? import <nixpkgs> {}
}:
let
nodePackages = import "${pkgs.path}/pkgs/top-level/node-packages.nix" {
inherit pkgs;
inherit (pkgs) stdenv fetchurl fetchgit;
nodejs = iojs;
neededNatives = [ pkgs.python ] ++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.utillinux;
self = nodePackages;
generated = ./packages.nix;
};
in rec {
tarball = pkgs.runCommand "foo.tgz" { buildInputs = [ pkgs.iojs ]; } ''
mv `HOME=$PWD npm pack ${foo}` $out
'';
build = nodePackages.buildNodePackage {
name = "foo";
src = [ tarball ];
buildInputs = nodePackages.nativeDeps."foo" or [];
deps = [];
peerDependencies = [];
};
}