From e5859bb3258351c19540eedd6a8d1dff14af1295 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 24 Jan 2021 17:34:30 +0100 Subject: back,pusher: reduce final derivation size While this still is a major hack, this reduces unused node_modules (about 200MB each) being pulled in from workadventure*-modules-* and workadventure-messages. --- back/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'back') diff --git a/back/default.nix b/back/default.nix index 5f92960..06325c7 100644 --- a/back/default.nix +++ b/back/default.nix @@ -62,6 +62,7 @@ yarn2nix-moretea.mkYarnPackage rec { ln -s ${workadventure.messages.outPath}/generated deps/${pname}/src/Messages/generated HOME=$TMPDIR yarn --offline run tsc cp -r deps/${pname}/dist $out/dist + rm -rf deps/${pname}/{src,node_modules} ''; postInstall = '' -- cgit v1.2.3 From 2d7380043979b6bc8e05cecda9d6277e1553777f Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Sun, 24 Jan 2021 17:37:03 +0100 Subject: back,pusher: fix node-pre-gyp libc detection This should fix libc detection carried out in https://github.com/lovell/detect-libc/blob/5173db0bc47608f89986d9125c2d868c08d5f429/lib/detect-libc.js#L44 when loading grpc bindings. --- back/default.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'back') diff --git a/back/default.nix b/back/default.nix index 06325c7..a7e0858 100644 --- a/back/default.nix +++ b/back/default.nix @@ -6,6 +6,8 @@ , nodejs-14_x , workadventure , yarn2nix-moretea +, lib +, getconf , ... }: let @@ -67,8 +69,11 @@ yarn2nix-moretea.mkYarnPackage rec { postInstall = '' # node-abi needs to the abi of the node here + # getconf is required for detect-libc (used by node-pre-gyp) to properly + # detect current libc makeWrapper '${nodejs-14_x}/bin/node' "$out/bin/${pname}" \ --set NODE_PATH $out/libexec/${pname}/node_modules \ + --prefix PATH : ${lib.makeBinPath [ getconf ]} \ --add-flags "$out/dist/server.js" ''; } -- cgit v1.2.3