Closed nixinator closed 2 years ago
Yeah, it's seems no matter what nixpkgs revision i try, this has never worked. So it's going to need to be packaged manually. Currently node2nix is generating a node-packages.nix file containing.
cat node-packages.nix | grep name | wc -l
2284
so if the above package is fixed, anyone on of the other 2284 packages that this repo needs might not build. So it's hard to estimate how much time this is going to take.
so, conversing with @MatthewCroughan , it's quite possible bufferutil@4.0.5 , because it's needs 'node-gyp-build' as a build dependency. This is even stated in the node2nix documentation. Here's a reminder.
A few exotic NPM packages may have dependencies on native libraries that reside somewhere on the user's host system. Unfortunately, NPM's metadata does not specify them, and as a consequence, it may result in failing Nix builds due to missing dependencies.
I'm hoping/wishing/praying that dream2nix can pick stuff like this up, but if it's not in the node package metadata then i can't see how that would work. What package manager doesn't declare all it's deps in the first place.. Absolutely shocking that this is use by millions of node developers around the world!. I'm guess I've just been spoilt with derivations, the clearly state there build and run time dependencies.
ok, no joy with node2nix , or in fact with a nix-shell (npm install/npm start) outside if a nix-build.
However, some joy with yarn within a nix-shell. I'll commit a branch for testing. Experimenting with yarn2nix may prove fruitful and get a working deployment with nix-build before going the 'star trek' route, with dream2nix.
@MatthewCroughan which branch has the dream2nix build in it? I'd like to give it a whirl.
@nixinator It's now in the main
branch thanks to the following commits:
The way npm works, with it's many many dependence, versions, it's habit of download compiled binaries on to your system, or in fact building C/C++ source code is not very nix friendly (at all)
Node2nix does it best to parse the package.json and create a nix derivation from that.
I'm going to rewind nixpkgs to an early revision as i've got a feeling this is a regression.