Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

error: Use upstream https://github.com/moretea/yarn2nix #98

Open
LinArcX opened this issue Apr 22, 2019 · 10 comments
Open

error: Use upstream https://github.com/moretea/yarn2nix #98

LinArcX opened this issue Apr 22, 2019 · 10 comments

Comments

@LinArcX
Copy link

LinArcX commented Apr 22, 2019

Hi. when i want to install yarn2nix, it give me an error:

nix-env -iA nixos.yarn2nix

warning: name collision in input Nix expressions, skipping '/home/linarcx/.nix-defexpr/channels_root/nixos'
error: Use upstream https://github.com/moretea/yarn2nix

And this is the output of:
nix-shell -p yarn2nix --show-trace
https://gist.github.com/LinArcX/849680b67c5d92682f6e8b9fb8b539de

@zimbatm
Copy link
Member

zimbatm commented Apr 25, 2019

yes, it was too much work to keep patches flowing both ways to yarn2nix was removed from nixpkgs. It also didn't work really well inside of nixpkgs because it depends on Import From Derivation which is not allowed in nixpkgs

@LinArcX
Copy link
Author

LinArcX commented Apr 27, 2019

Well, a temporary way to install yarn2nix:

nix-env -I yarn2nix=https://github.com/moretea/yarn2nix/archive/master.tar.gz -f '<yarn2nix>' -i yarn2nix -i yarn 

@nightkr
Copy link
Contributor

nightkr commented Apr 27, 2019

You probably don't want to install Yarn2nix anyway. If you omit yarnNix from mkYarnPackage then it will be generated automatically at build time from your yarn.lock.

@ghost
Copy link

ghost commented May 3, 2019

yes, it was too much work to keep patches flowing both ways to yarn2nix was removed from nixpkgs. It also didn't work really well inside of nixpkgs because it depends on Import From Derivation which is not allowed in nixpkgs

What do you suggest instead for packaging applications with nodejs dependencies in nixpkgs? I am about to suggest adding back yarn2nix to nixpkgs in NixOS/nixpkgs#60788, because I could not find another way.

@spinus
Copy link

spinus commented Dec 13, 2019

@petabyteboy I would agree, maybe it's won't be newest version, but at least some working one for a project or two.
Alternatively, you could just repackage it inside your mkDerivation, just for the project and any other package would need to do the same.

@ghost
Copy link

ghost commented Dec 13, 2019

yarn2nix has been added to nixpkgs and should be available as usual again, so I think this issue can beclosed.

@thomashoneyman
Copy link

Bumping this as indeed yarn2nix is available via nixpkgs under yarn2nix or yarn2nix-moretea.

@spinus
Copy link

spinus commented Apr 21, 2020

@LinArcX have some time to check?

@flokli
Copy link
Contributor

flokli commented May 17, 2020

@petabyteboy do you have some ideas on how to keep this best in sync?

I'm a bit concerned about things like the mkYarnPackage and fixup_yarn_lock attributes in nixpkgs not necessarily being compatible/in sync with what the yarn2nix attribute is pointing to…

@ghost
Copy link

ghost commented May 18, 2020

I think we have a pretty good method for updating the nixpkgs version with the update script. I usually run it when one of my PRs here was merged and also create a PR to update the nixpkgs version, because I usually need the fix in nixpkgs at some point.
I'm not really aware of many changes that make the generated yarn.nix files incompatible with older versions of yarn2nix. If there are such changes, maybe they should be batched together as a major release, with a new yarn.nix file format version attribute?

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

No branches or pull requests

6 participants