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

yarn workspaces #16

Open
qknight opened this issue Jun 10, 2018 · 1 comment
Open

yarn workspaces #16

qknight opened this issue Jun 10, 2018 · 1 comment

Comments

@qknight
Copy link

qknight commented Jun 10, 2018

i wonder if you encountered 'yarn workspaces' yet:

nix-community/yarn2nix#57

@Profpatsch
Copy link
Owner

Profpatsch commented Jun 11, 2018

Haven’t read the article in-depth, but if every dependency is in the top-level yarn.lock you can generate the nix package set with yarn2nix in the top-level and then use yarn2nix --template to generate one template nix file per subproject. Since we use self/super in the yarn2nix output, it should be possible to add the subrepos so they can see each other. I added a bit of functionality to overwrite package sets in the last commits on master.

Something like (untested):

let
  nodeDeps = nix-lib.buildNodeDeps (lib.composeExtensions
    (self: super: { 
      submodule1 = super._buildNodePackage
        (nix-lib.callTemplate ./submodule1/sub-package-template.nix self);
      submodule2 = …;
    })
    (pkgs.callPackage ./yarn-lock.nix {}));
in nix-lib.buildNodePackage
 ({ src = ./.; } //
    (nix-lib.callTemplate ./top-package-template.nix nodeDeps));

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

No branches or pull requests

2 participants