From f949de4fbb5c5adb7f3ec085206f48a2efdd1d9a Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 26 Sep 2022 17:18:52 +0200 Subject: [PATCH] mastodon: pass yarnOfflineCache as environment variable --- pkgs/servers/mastodon/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/mastodon/default.nix b/pkgs/servers/mastodon/default.nix index a312ecb76da7..7468b612cb47 100644 --- a/pkgs/servers/mastodon/default.nix +++ b/pkgs/servers/mastodon/default.nix @@ -16,11 +16,6 @@ stdenv.mkDerivation rec { # Putting the callPackage up in the arguments list also does not work. src = if srcOverride != null then srcOverride else callPackage ./source.nix {}; - yarnOfflineCache = fetchYarnDeps { - yarnLock = "${src}/yarn.lock"; - sha256 = "sha256-2NSibx026ENAqphGGhNoLwUldWTEPbDBrYu3hgeRlnM="; - }; - mastodon-gems = bundlerEnv { name = "${pname}-gems-${version}"; inherit version; @@ -45,6 +40,11 @@ stdenv.mkDerivation rec { pname = "${pname}-modules"; inherit src version; + yarnOfflineCache = fetchYarnDeps { + yarnLock = "${src}/yarn.lock"; + sha256 = "sha256-2NSibx026ENAqphGGhNoLwUldWTEPbDBrYu3hgeRlnM="; + }; + nativeBuildInputs = [ fixup_yarn_lock nodejs-slim yarn mastodon-gems mastodon-gems.wrappedRuby ]; RAILS_ENV = "production"; @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { # Otherwise we encounter this upstream issue: https://github.com/mastodon/mastodon/issues/17924 export NODE_OPTIONS=--openssl-legacy-provider fixup_yarn_lock ~/yarn.lock - yarn config --offline set yarn-offline-mirror ${yarnOfflineCache} + yarn config --offline set yarn-offline-mirror $yarnOfflineCache yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress patchShebangs ~/bin