2019-01-02 11:24:55 +00:00
|
|
|
{pkgs, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-8_x"}:
|
2018-12-01 17:26:29 +00:00
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
let
|
|
|
|
d1 = stdenv.mkDerivation {
|
2018-12-06 15:57:26 +00:00
|
|
|
name = "nanopos-sources";
|
2018-12-01 17:26:29 +00:00
|
|
|
src = fetchurl {
|
2018-12-06 15:57:26 +00:00
|
|
|
url = "https://registry.npmjs.org/nanopos/-/nanopos-0.1.4.tgz";
|
|
|
|
sha256 = "294c4ac90027e5172408dadad9a62e0117459e4c60d4ab362b12190887c698ec";
|
2018-12-01 17:26:29 +00: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
|