mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 23:20:55 +00:00
nodePackages: Update to npm2nix 2.0 format
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
483755e9ab
commit
a895082e56
File diff suppressed because it is too large
Load diff
|
@ -7,23 +7,29 @@ let
|
||||||
let
|
let
|
||||||
all = pkgs.lib.fold (pkg: { top-level, full }: {
|
all = pkgs.lib.fold (pkg: { top-level, full }: {
|
||||||
top-level = top-level ++ pkgs.lib.optional pkg.topLevel {
|
top-level = top-level ++ pkgs.lib.optional pkg.topLevel {
|
||||||
name = pkg.baseName;
|
name = pkg.name;
|
||||||
value = builtins.getAttr pkg.fullName self.full;
|
value = builtins.getAttr pkg.spec (builtins.getAttr pkg.name self.full);
|
||||||
};
|
};
|
||||||
full = [ {
|
full = full // builtins.listToAttrs [ {
|
||||||
name = pkg.fullName;
|
inherit (pkg) name;
|
||||||
value = pkgs.lib.makeOverridable buildNodePackage rec {
|
value = (if builtins.hasAttr pkg.name full
|
||||||
name = "${pkg.baseName}-${pkg.version}";
|
then builtins.getAttr pkg.name full
|
||||||
src = (if pkg.patchLatest then patchLatest else fetchurl) {
|
else {}
|
||||||
url = "http://registry.npmjs.org/${pkg.baseName}/-/${name}.tgz";
|
) // builtins.listToAttrs [ {
|
||||||
sha256 = pkg.hash;
|
name = pkg.spec;
|
||||||
|
value = pkgs.lib.makeOverridable buildNodePackage {
|
||||||
|
name = "${pkg.name}-${pkg.version}";
|
||||||
|
src = (if pkg.patchLatest then patchLatest else fetchurl) {
|
||||||
|
url = pkg.tarball;
|
||||||
|
sha1 = pkg.sha1 or "";
|
||||||
|
sha256 = pkg.sha256 or "";
|
||||||
|
};
|
||||||
|
deps = map (dep: builtins.getAttr dep.spec (builtins.getAttr dep.name self.full)) pkg.dependencies;
|
||||||
};
|
};
|
||||||
deps = map (dep: builtins.getAttr "${dep.name}-${dep.range}" self.full) pkg.dependencies;
|
} ];
|
||||||
buildInputs = if builtins.hasAttr name nativeDeps then builtins.getAttr name nativeDeps else [];
|
} ];
|
||||||
};
|
} ) { top-level = []; full = {}; } generated;
|
||||||
} ] ++ full;
|
in builtins.listToAttrs all.top-level // { inherit (all) full; };
|
||||||
} ) { top-level = []; full = []; } generated;
|
|
||||||
in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; };
|
|
||||||
in {
|
in {
|
||||||
inherit importGeneratedPackages;
|
inherit importGeneratedPackages;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue