[Nix-dev] On npm2nix and the NPM package set in Nixpkgs

Colin Putney colin at wiresong.com
Sun Jul 17 02:15:10 CEST 2016


On Thu, Jul 14, 2016 at 4:19 AM, Tomasz Czyż <tomasz.czyz at gmail.com> wrote:


> Are you sure that having multiple tools/solutions is frustrating? Maybe
> it's just lack of description or documentation?
> (btw, currently there is only one, Sander is trying to introduce second
> "official" one if I understand situation correctly).
>

Actually, I think that in this case, two separate tools might be called
for. For dealing with the craziness that is npm, I see two approaches.

One is the nix-centric approach of the existing npm2nix: each package gets
its own derivation, and dependencies are symlinked into the node_modules
directory. That's simple fits most closely with the way native nix packages
work. The main problem with this is that npm does "clever" things to work
around problems with its design, and some npm packages have undeclared
dependencies that only work because of the quirks of npm. These packages
are fairly rare, but they do crop up from time to time.

The other approach is more npm-centric. The idea is to mimic the quirks of
npm as exactly as possible, so that all packages find themselves in exactly
the environment they expect. This leads to other problems, such as slower
execution and bloated derivations.

So it might actually be a good idea to have two different tools, each of
which make different engineering tradeoffs.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160716/57fcbd13/attachment-0001.html>


More information about the nix-dev mailing list