2019-01-02 03:24:55 -08:00
|
|
|
{pkgs, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-8_x"}:
|
2018-12-01 09:26:29 -08:00
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
let
|
|
|
|
d1 = stdenv.mkDerivation {
|
2018-12-06 07:57:26 -08:00
|
|
|
name = "nanopos-sources";
|
2018-12-01 09:26:29 -08:00
|
|
|
src = fetchurl {
|
2018-12-06 07:57:26 -08:00
|
|
|
url = "https://registry.npmjs.org/nanopos/-/nanopos-0.1.4.tgz";
|
|
|
|
sha256 = "294c4ac90027e5172408dadad9a62e0117459e4c60d4ab362b12190887c698ec";
|
2018-12-01 09:26:29 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ nodePackages.node2nix git ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
tar -xzf $src -C $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cd $out/package
|
|
|
|
${nodePackages.node2nix}/bin/node2nix -8 package.json
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
# import from derivation (IFD)
|
|
|
|
packages = import (d1 + "/package/default.nix") {
|
|
|
|
inherit pkgs system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
packages
|