summary refs log tree commit diff
path: root/pkgs/top-level/node-packages.nix
blob: 8725ce1e9cd76ae78a96dcaa802da1e38664701b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ pkgs, stdenv, nodejs, fetchurl, neededNatives, self, generated ? ./node-packages-generated.nix }:

{
  nativeDeps = {
    "node-expat"."*" = [ pkgs.expat ];
    "rbytes"."*" = [ pkgs.openssl ];
    "phantomjs"."~1.9" = [ pkgs.phantomjs ];
  };

  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 *
    '';

  /* Put manual packages below here (ideally eventually managed by npm2nix */
} // import generated { inherit self fetchurl; inherit (pkgs) lib; }