From 499b26b7b8464238af0b0893c1319ed94425a7f0 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 26 Sep 2022 17:13:14 +0200 Subject: [PATCH] discourse.assets: pass yarnOfflineCache as environment variable --- pkgs/servers/web-apps/discourse/default.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix index 5035407c48db..5c53c1202269 100644 --- a/pkgs/servers/web-apps/discourse/default.nix +++ b/pkgs/servers/web-apps/discourse/default.nix @@ -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 {