node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

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

Open andir opened this issue 6 years ago • 2 comments

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.

andir avatar Dec 28 '19 14:12 andir

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?

svanderburg avatar Mar 10 '20 20:03 svanderburg

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.

andir avatar May 23 '20 20:05 andir