30 lines
543 B
Nix
30 lines
543 B
Nix
{
|
|
pkgs,
|
|
src,
|
|
nodejs ? pkgs.nodejs_24,
|
|
}:
|
|
let
|
|
project = (pkgs.callPackage (src + "/yarn-project.nix") { inherit nodejs; }) {
|
|
inherit src;
|
|
overrideAttrs = _: {
|
|
buildPhase = "runHook preBuild; runHook postBuild";
|
|
installPhase = ''
|
|
runHook preInstall
|
|
test -d node_modules
|
|
mkdir -p "$out"
|
|
cp -a node_modules/. "$out/"
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
};
|
|
in
|
|
project
|
|
// {
|
|
devShell = pkgs.mkShell {
|
|
packages = [
|
|
nodejs
|
|
project.yarn-freestanding
|
|
];
|
|
};
|
|
}
|