Re:The Magic Nix Cache, a GitHub Action for speeding up your...
by soraminazuki on Monday June 26, 2023 @09:52PM
(#36488079)
Nowadays, there's buildNpmPackage [1]. It's included in Nixpkgs, actively maintained, and easier to work with IMO.
[1]: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-f...
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.