svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
525 stars 100 forks source link

Make source path / fetcher configurable for out of tree nix expressions #165

Open andir opened 4 years ago

andir commented 4 years ago

I started creating a Nix expression for a project that I do not maintain and that will probably not accept the Nix expression into their repository.

To ease updating of future versions I wrote a nix-shell driven updater that invokes node2nix. So far this is working great.

In order to make it work out of tree and for others I had to start patching the generated files to allow me to specify the source expression of the actual package I want to build.

Here is my current hack: https://git.darmstadt.ccc.de/andi/matrix-appservice-irc-nix/blob/master/upgrade.nix#L25-32

The generated files would refer to ../../../../…/nix/store/… which obviously isn't going to work for others or even after a GC.

My proposal would be another CLI option that allows me to specify the path and/or expression that should be used in the generated nix files.

svanderburg commented 4 years ago

Hi, I already have some long term plans on my drawing board to bring some responsibilities of node2nix to a companion tool.

What is your main use case? You need something that can populate the node_modules/ folder without using NPM?

andir commented 4 years ago

My main use case is to have a nix expression in my repository to build something that is not in the local checkout. I basically want a way to have a build from source tarball (fetchurl) instead of a local checkout.