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 {
inherit pkgs stdenv nodejs fetchurl;
neededNatives = [python] ++ lib.optional (lib.elem system lib.platforms.linux) utillinux;
self = pkgs.nodePackages;
});
ldns = callPackage ../development/libraries/ldns { };

View File

@ -1,4 +1,4 @@
{ pkgs, stdenv, nodejs, fetchurl, neededNatives }:
{ pkgs, stdenv, nodejs, fetchurl, neededNatives, self }:
let
inherit (self) buildNodePackage patchLatest;
@ -24,30 +24,28 @@ let
} ] ++ full;
} ) { top-level = []; full = []; } generated;
in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; };
in {
inherit importGeneratedPackages;
self = {
inherit importGeneratedPackages;
nativeDeps = {
"node-expat-*" = [ pkgs.expat ];
"rbytes-0.0.2" = [ pkgs.openssl ];
};
nativeDeps = {
"node-expat-*" = [ pkgs.expat ];
"rbytes-0.0.2" = [ pkgs.openssl ];
};
buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
inherit stdenv nodejs neededNatives;
inherit (pkgs) runCommand;
};
buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
inherit stdenv nodejs neededNatives;
inherit (pkgs) runCommand;
};
patchLatest = srcAttrs:
let src = fetchurl srcAttrs; in pkgs.runCommand src.name {} ''
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:
let src = fetchurl srcAttrs; in pkgs.runCommand src.name {} ''
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
/* Put manual packages below here (ideally eventually managed by npm2nix */
} // importGeneratedPackages (import ./node-packages-generated.nix) self.nativeDeps self