3
0
Fork 0
forked from mirrors/nixpkgs

mkYarnModules: allow passing custom offlineCache

This commit is contained in:
Yureka 2021-10-06 18:26:50 +02:00 committed by Yuka
parent d6e0195ccd
commit cf6f772676

View file

@ -68,6 +68,7 @@ in rec {
packageJSON, packageJSON,
yarnLock, yarnLock,
yarnNix ? mkYarnNix { inherit yarnLock; }, yarnNix ? mkYarnNix { inherit yarnLock; },
offlineCache ? importOfflineCache yarnNix,
yarnFlags ? defaultYarnFlags, yarnFlags ? defaultYarnFlags,
pkgConfig ? {}, pkgConfig ? {},
preBuild ? "", preBuild ? "",
@ -75,8 +76,6 @@ in rec {
workspaceDependencies ? [], # List of yarn packages workspaceDependencies ? [], # List of yarn packages
}: }:
let let
offlineCache = importOfflineCache yarnNix;
extraBuildInputs = (lib.flatten (builtins.map (key: extraBuildInputs = (lib.flatten (builtins.map (key:
pkgConfig.${key}.buildInputs or [] pkgConfig.${key}.buildInputs or []
) (builtins.attrNames pkgConfig))); ) (builtins.attrNames pkgConfig)));
@ -227,6 +226,7 @@ in rec {
packageJSON ? src + "/package.json", packageJSON ? src + "/package.json",
yarnLock ? src + "/yarn.lock", yarnLock ? src + "/yarn.lock",
yarnNix ? mkYarnNix { inherit yarnLock; }, yarnNix ? mkYarnNix { inherit yarnLock; },
offlineCache ? importOfflineCache yarnNix,
yarnFlags ? defaultYarnFlags, yarnFlags ? defaultYarnFlags,
yarnPreBuild ? "", yarnPreBuild ? "",
yarnPostBuild ? "", yarnPostBuild ? "",
@ -253,7 +253,7 @@ in rec {
preBuild = yarnPreBuild; preBuild = yarnPreBuild;
postBuild = yarnPostBuild; postBuild = yarnPostBuild;
workspaceDependencies = workspaceDependenciesTransitive; workspaceDependencies = workspaceDependenciesTransitive;
inherit packageJSON pname version yarnLock yarnNix yarnFlags pkgConfig; inherit packageJSON pname version yarnLock offlineCache yarnFlags pkgConfig;
}; };
publishBinsFor_ = unlessNull publishBinsFor [pname]; publishBinsFor_ = unlessNull publishBinsFor [pname];