Nixify yarn (v3) with flake

Cool project I never used before. Can’t help much, but two remarks:

  1. stupid question, but have you run:
yarn plugin import https://raw.githubusercontent.com/stephank/yarn-plugin-nixify/main/dist/yarn-plugin-nixify.js

to install the plugin at your collegues’s computer?
2. Do you/they run NixOs or another distribution?
3. Is yarn recent enough? Yarn >= 3.1.0 or >= 4.0.0.

Have you tried dream2nix? I’m not sure to understand the yarn’s state right now: this issue Trouble Using Yarn Lockfile (nodejs-package-lock-v3) · Issue #837 · nix-community/dream2nix · GitHub suggests that is is not supported yet, but this comment says something else:

Second on dream2nix. I’ve used it extensively to package extremely complex yarn-based monorepos with workspaces and a variety of other off use cases, with close to 100% success rate with nodejs-based packages. The nodejs ecosystem is pretty much solved for dream2nix. It has support for both pure (package-lock.json, yarn.lock) and impure translations and provides many paths to solve various problems, such as package overrides, dependency injections, building without devDependencies (so build from the outside with nix instead), etc.

Also, do you have strong reasons to use yarn? This posts suggests that yarn has some fundamental issues compared to npm Yarn Plug'n'Play and direnv/packaging - #2 by Growpotkin

1 Like