node2nix
nix-npm-buildpackage
Our great sponsors
node2nix | nix-npm-buildpackage | |
---|---|---|
4 | 4 | |
486 | 97 | |
- | - | |
0.0 | 3.3 | |
6 months ago | 7 months ago | |
Nix | Nix | |
MIT License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
node2nix
-
The Magic Nix Cache
You may find something like node2nix helpful (https://github.com/svanderburg/node2nix). This converts your package.json into a Nix expression that can then be cached. You're right that it does require some setup and a bit of Nix knowledge but could yield significant benefits and take a good chunk out of that 20 minutes.
Another option might be to use pnpm instead of Yarn and cache your pnpm dependencies. pnpm actually works a bit like Nix in that it creates a pnpm-lock.yaml file with content-based hashes for the full package.json dependency tree. This enables it to quickly determine which parts of the dependency tree it needs to build and which are already available.
-
Override `nodePackages' with the `default.nix' from `node2nix' multiple times
I got it from this github issue in the node2nix repo.
-
how to install Mozilla's readability library?
As Gerschtli commented, it may be possible to generate a Nix expression for @mozilla/readability using node2nix. Then get its node_modules path like this and set NODE_PATH to the value.
-
How to install dependencies with Nix?
For node programs, you may be able to find the commands as just packages, or look at https://github.com/svanderburg/node2nix for creating the nix equivalent of a node-modules
nix-npm-buildpackage
-
How do you build NodeJS project in Nix? 2022
https://github.com/serokell/nix-npm-buildpackage .
-
How to build clojurescript project with nix?
The struggle began when I tried to set up nix build to build my webapp. The issue is that clojure have some dependencies and npm has other dependencies. First I managed to get all nom dependencies included by using npm-buildpackage. This seems to be working correctly. However when building the application with shadow-cljs it fails. My guess is that it fails when trying to get dependencies from my deps.edn file.
-
Could you give me some tips on using node2nix or yarn2nix to install node packages that are not in the main node packages repo:
I’ve spent too much time trying to make mkYarnPackage from nixpkgs to work and finally found https://github.com/serokell/nix-npm-buildpackage, which at least for yarn pretty much worked out of the box for me.
-
How to install dependencies with Nix?
I usually got by with the python stuff in nixpkgs. Other than that for applications I would probably recommend poetry2nix as mentioned. For the nodejs I would use https://github.com/serokell/nix-npm-buildpackage
What are some alternatives?
nixpkgs - Nix Packages collection & NixOS
dream2nix - Simplified nix packaging for various programming language ecosystems [maintainer=@DavHau]
nur-packages - My NUR packages
nix-darwin - nix modules for darwin
readability-cli
Home Manager using Nix - Manage a user environment using Nix [maintainer=@rycee]
at-node-nix - Node.js Nix expressions
hasql-interpolate
math-preview
relocatable.nix - A nix bundler that produces relocatable deployment script for nix store paths.
clj-nix - Nix helpers for Clojure projects