3
0
Fork 0
forked from mirrors/nixpkgs

mastodon: pass yarnOfflineCache as environment variable

This commit is contained in:
Yureka 2022-09-26 17:18:52 +02:00
parent 71b5df8b60
commit f949de4fbb

View file

@ -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