discourse.assets: pass yarnOfflineCache as environment variable

This commit is contained in:
Yureka 2022-09-26 17:13:14 +02:00
parent f949de4fbb
commit 499b26b7b8

View file

@ -159,15 +159,15 @@ let
];
};
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/app/assets/javascripts/yarn.lock";
sha256 = "0s8cmy76xh4z9y932bjshmpyr04zn3yn62ld9174lks2j965qkbl";
};
assets = stdenv.mkDerivation {
pname = "discourse-assets";
inherit version src;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/app/assets/javascripts/yarn.lock";
sha256 = "0s8cmy76xh4z9y932bjshmpyr04zn3yn62ld9174lks2j965qkbl";
};
nativeBuildInputs = runtimeDeps ++ [
postgresql
redis
@ -203,7 +203,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 app/assets/javascripts/yarn.lock
@ -261,10 +261,6 @@ let
runHook postInstall
'';
passthru = {
inherit yarnOfflineCache;
};
};
discourse = stdenv.mkDerivation {