nixpkgs/pkgs/tools/networking/pgrok/web.nix
2023-09-25 17:06:01 +02:00

30 lines
588 B
Nix

{ src
, version
, nodejs
, nodePackages
, stdenvNoCC
}:
let
build-deps = nodePackages."pgrok-build-deps-../../tools/networking/pgrok/build-deps";
in
stdenvNoCC.mkDerivation {
pname = "pgrok-web";
inherit version;
src = "${src}/pgrokd/web";
nativeBuildInputs = [ nodejs ];
buildPhase = ''
runHook preBuild
cp ${./build-deps/package.json} package.json
ln -s ${build-deps}/lib/node_modules/pgrokd/node_modules node_modules
npm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
}