From 51c362c5306d940f4ab10b8604de3de3425b8195 Mon Sep 17 00:00:00 2001 From: Nick Novitski Date: Tue, 12 Jul 2022 19:15:52 -0700 Subject: [PATCH] Add passthru yarn derivation This can be used to run any scripts in the package. --- src/tmpl/yarn-project.nix.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tmpl/yarn-project.nix.in b/src/tmpl/yarn-project.nix.in index 202860e..3de95d4 100644 --- a/src/tmpl/yarn-project.nix.in +++ b/src/tmpl/yarn-project.nix.in @@ -1,7 +1,7 @@ # This file is generated by running "yarn install" inside your project. # 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: let @@ -151,6 +151,13 @@ let passthru = { inherit nodejs; + yarn = writeShellApplication { + name = "yarn"; + runtimeInputs = [ nodejs ]; + text = '' + ${yarnPath} --cwd ${project}/libexec/${project.name} "$@" + ''; + }; }; });