Open LinArcX opened 5 years ago
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
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
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
.
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 https://github.com/NixOS/nixpkgs/pull/60788, because I could not find another way.
@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.
yarn2nix has been added to nixpkgs and should be available as usual again, so I think this issue can beclosed.
Bumping this as indeed yarn2nix is available via nixpkgs under yarn2nix or yarn2nix-moretea.
@LinArcX have some time to check?
@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…
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?
Hi. when i want to install yarn2nix, it give me an error:
nix-env -iA nixos.yarn2nix
And this is the output of:
nix-shell -p yarn2nix --show-trace
https://gist.github.com/LinArcX/849680b67c5d92682f6e8b9fb8b539de