Closed adrian-gierakowski closed 1 year ago
Cross referencing similar topic on a similar project: https://github.com/stephank/yarn-plugin-nixify/issues/63
Hi @adrian-gierakowski
Yes you can have a top level yarn.lock
, this is what I do, although there's no "one massive derivation". The yarn plugin generates a yarn-manifest.nix
file which is basically just a version of yarn.lock
that the Nix part of this library can better understand. Each package is its own derivation, whether that's your own packages in the workspace or dependencies. Because of this, if you build a package in your workspace that only has a few dependencies, only those dependencies will be built rather than every dependency of the entire workspace.
That said, I can't see any problems if you use separate yarn.lock files, you'll just need to install the yarn plugin and generate the yarn-manifest.nix
for each corresponding yarn.lock and pass it to mkYarnPackagesFromManifest
like so:
I hope that helps.
@madjam002 awesome, thanks!
If each package gets its own derivation depending only on the deps they actually use then I don’t need separate lock files.
I’ll give it a spin next week!
Btw. is there support for private npm registries? I’ve added it to my fork of yarn-plugin-nixify so if not I could open a PR if I end up using your project at work.
Hi @madjam002
I understand that you are using this plugin with some large workspaces.
Would you mind sharing how you handle building sub-projects within a workspace? Do you just build them all in one massive derivation based on top level yarn.lock? Or do you maintain individual lock files for sub-projects which allow them to be built in isolation?
Thanks!