Open markus1189 opened 5 years ago
Hi,
I assume that you want to create an executable for an NPM package that executes the appropriate commands to start the app?
You can also create an override, then use the postInstall
hook to populate a the bin/
directory with a shell script executable that executes the start process. The README.md file of node2nix
describes how this hook can be used.
If you are looking for examples, in the Nixpkgs repository, the pkgs/development/node-packages/default-v8.nix
creates wrapped executables for node2nix
and pnpm2nix
. You can do something similar -- instead of wrapping the executable, generate a shell script from scratch.
Hi,
I am currently building the APL IDE
ride
from https://github.com/Dyalog/ride/The
node2nix
command works perfectly in a local clone of the package, I cannix-build
the generateddefault.nix
and inside of the result, I can run theelectron
app usingnpm start
.So far so good, I am now wondering, how I could wrap this whole process up in a single nix file that generates the built electron app and adds an wrapper that just calls
npm start
, but I don't know how to do this.I guess it would help, if there is a way to set the
src
directory for the derivation generated bynode2nix
, could this be done?