Make overrides of nodePackages work

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-05-31 12:50:28 -04:00
parent 758f20f0b8
commit 210246266d
2 changed files with 23 additions and 24 deletions

View File

@ -1101,6 +1101,7 @@ let
nodePackages = recurseIntoAttrs (import ./node-packages.nix { nodePackages = recurseIntoAttrs (import ./node-packages.nix {
inherit pkgs stdenv nodejs fetchurl; inherit pkgs stdenv nodejs fetchurl;
neededNatives = [python] ++ lib.optional (lib.elem system lib.platforms.linux) utillinux; neededNatives = [python] ++ lib.optional (lib.elem system lib.platforms.linux) utillinux;
self = pkgs.nodePackages;
}); });
ldns = callPackage ../development/libraries/ldns { }; ldns = callPackage ../development/libraries/ldns { };

View File

@ -1,4 +1,4 @@
{ pkgs, stdenv, nodejs, fetchurl, neededNatives }: { pkgs, stdenv, nodejs, fetchurl, neededNatives, self }:
let let
inherit (self) buildNodePackage patchLatest; inherit (self) buildNodePackage patchLatest;
@ -24,30 +24,28 @@ let
} ] ++ full; } ] ++ full;
} ) { top-level = []; full = []; } generated; } ) { top-level = []; full = []; } generated;
in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; }; in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; };
in {
inherit importGeneratedPackages;
self = { nativeDeps = {
inherit importGeneratedPackages; "node-expat-*" = [ pkgs.expat ];
"rbytes-0.0.2" = [ pkgs.openssl ];
};
nativeDeps = { buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
"node-expat-*" = [ pkgs.expat ]; inherit stdenv nodejs neededNatives;
"rbytes-0.0.2" = [ pkgs.openssl ]; inherit (pkgs) runCommand;
}; };
buildNodePackage = import ../development/web/nodejs/build-node-package.nix { patchLatest = srcAttrs:
inherit stdenv nodejs neededNatives; let src = fetchurl srcAttrs; in pkgs.runCommand src.name {} ''
inherit (pkgs) runCommand; mkdir unpack
}; cd unpack
tar xf ${src}
mv */ package 2>/dev/null || true
sed -i -e "s/: \"latest\"/: \"*\"/" package/package.json
tar cf $out *
'';
patchLatest = srcAttrs: /* Put manual packages below here (ideally eventually managed by npm2nix */
let src = fetchurl srcAttrs; in pkgs.runCommand src.name {} '' } // importGeneratedPackages (import ./node-packages-generated.nix) self.nativeDeps self
mkdir unpack
cd unpack
tar xf ${src}
mv */ package 2>/dev/null || true
sed -i -e "s/: \"latest\"/: \"*\"/" package/package.json
tar cf $out *
'';
/* Put manual packages below here (ideally eventually managed by npm2nix */
} // importGeneratedPackages (import ./node-packages-generated.nix) self.nativeDeps self;
in self