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
yarn2nix: Init at 0.1.0 #35340
yarn2nix: Init at 0.1.0 #35340
Conversation
rm -rf $out/node_modules/${pname}/node_modules | ||
|
||
mkdir $out/bin | ||
node ${"${src}/nix/fixup_bin.js"} $out ${lib.concatStringsSep " " publishBinsFor_} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe fixup_bin.js should be in it's own derivation to avoid needing the yarn2nix source for every mkYarnPackage invocation. it's just a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't want to spread this out into 3 locations, I already reverted moving all of yarn2nix into nixpkgs to instead only put the .nix
files in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean writeScript "fixup_bin.js" (builtins.readFile "${src}/nix/fixup_bin.js")
. It's a small optimization and it doesn't really matter right now.
It looks like there is an issue with reading the package.json from the src. Maybe it's not allowed in a strict evaluation setting. /cc @grahamc |
@zimbatm so I decided to just get all the needed files into nixpkgs since all other options would either fragment the source or fail to evaluate. It's not too much hopefully :) |
I'm not sure it would solve the problem for other packages that want to use yarn2nix inside of nixpkgs. @GrahamcOfBorg build yarn2nix |
Success on x86_64-darwin (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Motivation for this change
This is required to be able to build derivations using
mkYarnPackage
andmkYarnModules
.Unfortunately this means copying most of the source from the https://github.com/moretea/yarn2nix project, since It's not possible to load remote derivations yet.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)