Packaging a nodejs project with multiple yarn.lock files

Hello, newbie here, trying to write a nixpkgs package for RedisInsight. It is a pretty basic nodejs electron project built with yarn, here is the repo.

I forked the nixpkgs repository, cloned it locally and made the following changes. To test, I have been running this command: NIXPKGS_ALLOW_UNFREE=1 nix-build -A redis-insight

The build starts, and it tries to run the buildPhase script, but complains about missing packages. I am using the mkYarnPackage utility, and I suspect the issue is that this project has three yarn.lock files (one , two and three).

How can I ensure that I fetch all the dependencies from all the lockfiles?

Thanks!

You can’t currently. A workaround would be to fetch each yarn.lock in a different derivation and maybe even build some things and then combine them in a final derivation.

Ok cool, that makes sense. Thanks. Haven’t dealt with combining derivations before. Could you point me in the direction of an example from nixpkgs?

the only example I could think of right now would be mastodon https://github.com/NixOS/nixpkgs/blob/ab7b093937035ec80899c35955d37d6b46f68af9/pkgs/servers/mastodon/default.nix

Thank you, I’ll take a look. I’m sure there must be some way to combine all the dependencies into a single cache.