gitlab.assets: pass yarnOfflineCache as environment variable

This commit is contained in:
Yureka 2022-09-26 17:12:03 +02:00
parent 30b725dd9b
commit 835e110915

View File

@ -50,15 +50,15 @@ let
extraConfigPaths = lib.forEach data.vendored_gems (gem: "${src}/vendor/gems/${gem}");
};
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = data.yarn_hash;
};
assets = stdenv.mkDerivation {
pname = "gitlab-assets";
inherit version src;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = data.yarn_hash;
};
nativeBuildInputs = [ rubyEnv.wrappedRuby rubyEnv.bundler nodejs yarn git cacert ];
patches = [
@ -91,7 +91,7 @@ let
export HOME=$NIX_BUILD_TOP/fake_home
# Make yarn install packages from our offline cache, not the registry
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
# Fixup "resolved"-entries in yarn.lock to match our offline cache
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock