[Nix-dev] Simplify node packages?
Benno Fünfstück
benno.fuenfstueck at gmail.com
Sun Apr 23 15:10:59 CEST 2017
Hello,
the nodejs infrastructure in nixpkgs looks quite complex to me. I'm sure
that there are good reasons for this. In particular, can someone answer the
following questions, as I am not intimately familar with the full NPM
ecosystem:
Both of the following approaches change the concept from "one derivation
per npm library" to "one or two derivations per npm *application/tool*"
(libraries are build together with the application, in the same
derivation).
* A simple approach to packaging NPM applications would be to split the
package for an NPM application into two:
- fetch: let NPM download all the dependencies. it should(?) be possible
to make this a fixed-output derivation, as long as NPM downloads the same
set of dependencies each time
- build: use the cache from the fetch phase, should require no network
access
The fetch phase should be deterministic if we freeze the NPM index (is such
a thing possible?) and use shrinkwrap.
Or is this not the case? In what cases will it fail to be deterministic?
* Alternatively, `yarn` claims to be more deterministic. Can we use `yarn`
to build all NPM packages? Or are there NPM packages that are incompatible?
I have read the articles from Sander van der Burg, but they don't seem to
explain why we went with "one derivation per library", which requires us to
manually symlink things into the node_modules folder.
Kind regards,
Benno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170423/7642a305/attachment-0001.html>
More information about the nix-dev
mailing list