npm2nix icon indicating copy to clipboard operation
npm2nix copied to clipboard

Generates incorrect default.nix for iojs

Open LnL7 opened this issue 9 years ago • 0 comments

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 = [];
  };
}

LnL7 avatar May 05 '15 10:05 LnL7