Add passthru yarn derivation

This can be used to run any scripts in the package.
This commit is contained in:
Nick Novitski
2022-07-12 19:15:52 -07:00
parent bd14afe6cd
commit 51c362c530
+8 -1
View File
@@ -1,7 +1,7 @@
# This file is generated by running "yarn install" inside your project. # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution! # Manual changes might be lost - proceed with caution!
{ lib, nodejs, stdenv, fetchurl, writeText, git, cacert }: { lib, nodejs, stdenv, fetchurl, writeText, git, cacert, writeShellApplication }:
{ src, overrideAttrs ? null, ... } @ args: { src, overrideAttrs ? null, ... } @ args:
let let
@@ -151,6 +151,13 @@ let
passthru = { passthru = {
inherit nodejs; inherit nodejs;
yarn = writeShellApplication {
name = "yarn";
runtimeInputs = [ nodejs ];
text = ''
${yarnPath} --cwd ${project}/libexec/${project.name} "$@"
'';
};
}; };
}); });