node2nix
node2nix copied to clipboard
help/how-to fix build-time downloaded file in dependent npm package?
Describe the bug
vscode-ripgrep
tries to download a binary at runtime: https://github.com/microsoft/vscode-ripgrep/blob/master/lib/postinstall.js#L50
I'd like to pre-link the ripgrep binary into place in the bin
directory before postInstall
runs to avoid this issue entirely.
However, I absolutely cannot figure out how to do this. I have a package.json
that includes some theia
components, which in turn, then include vscode-ripgrep
.
I've tried overriding hte package per the instructions in the readme, but I don't see how that's even supposed to work. This seems to have just generated one single huge nodeDependencies that just includes every single dependent tarball unpacked. I don't see how I'm supposed to hook into just vscode-ripgrep
to fix it.
I've also tried just like this, but nothing has worked:
mkdir -p $out/lib/node_modules/theia-nix-test/node_modules/vscode-ripgrep
ln -s ${ripgrep}/bin/rg $out/lib/node_modules/theia-nix-test/node_modules/vscode-ripgrep/rg
before the call to:
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}