Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: How to use pkgs.yarn2nix-moretea.linkNodeModulesHook #217252

Open
3 tasks done
l0b0 opened this issue Feb 20, 2023 · 3 comments
Open
3 tasks done

Documentation: How to use pkgs.yarn2nix-moretea.linkNodeModulesHook #217252

l0b0 opened this issue Feb 20, 2023 · 3 comments

Comments

@l0b0
Copy link
Contributor

l0b0 commented Feb 20, 2023

Problem

I can't find any usage documentation or examples other than this comment:

This can be used as a shellHook in mkYarnPackage. It brings the built node_modules into the shell-hook environment.

How is it meant to be used in mkYarnWorkspace?

Basically, how do you set up a Nix shell with Yarn module executables on $PATH?

Proposal

Checklist

Ping @zimbatm as the original developer and @frontsideair because of this comment.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-use-pkgs-yarn2nix-moretea-linknodemoduleshook-in-nix-shell/25609/1

@zimbatm
Copy link
Member

zimbatm commented Feb 20, 2023

I haven't touched this for a while. I recommend looking at npmlock2nix v2, if you can switch back to npm: https://github.com/nix-community/npmlock2nix/blob/master/API.md

@l0b0
Copy link
Contributor Author

l0b0 commented Feb 20, 2023

Thanks for the tip, @zimbatm! I might look into that (using synp --source-file yarn.lock to convert the lock file) once it's more appropriate for my use case:

  • I don't know whether it puts node_modules/.bin on the path
  • It's not in nixpkgs
  • It only provides niv install instructions, but I'd rather not pull in yet another tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants