masto update
This commit is contained in:
parent
cb4949cc10
commit
71449b62aa
9 changed files with 575 additions and 478 deletions
|
@ -1,6 +1,13 @@
|
|||
/*
|
||||
Copied from nixpkgs upstream:
|
||||
https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/servers/mastodon/default.nix
|
||||
|
||||
Modifications for new yarn lockfiles stolen (with permission) from:
|
||||
https://git.catgirl.cloud/999eagle/dotfiles-nix/-/blob/main/overlay/mastodon/glitch/yarn.nix
|
||||
*/
|
||||
|
||||
{ lib, stdenv, nodejs-slim, bundlerEnv, nixosTests
|
||||
, yarn, callPackage, imagemagick, ffmpeg, file, ruby, writeShellScript
|
||||
, fetchYarnDeps, prefetch-yarn-deps
|
||||
, yarn-berry, callPackage, imagemagick, ffmpeg, file, ruby, writeShellScript
|
||||
, brotli
|
||||
|
||||
# Allow building a fork or custom version of Mastodon:
|
||||
|
@ -40,12 +47,13 @@ stdenv.mkDerivation rec {
|
|||
pname = "${pname}-modules";
|
||||
inherit src version;
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
# use the fixed yarn berry offline cache thingy
|
||||
yarnOfflineCache = callPackage ./yarn.nix {
|
||||
inherit src;
|
||||
hash = yarnHash;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ prefetch-yarn-deps nodejs-slim yarn mastodonGems mastodonGems.wrappedRuby brotli ];
|
||||
nativeBuildInputs = [ nodejs-slim yarn-berry mastodonGems mastodonGems.wrappedRuby brotli ];
|
||||
|
||||
RAILS_ENV = "production";
|
||||
NODE_ENV = "production";
|
||||
|
@ -57,9 +65,12 @@ stdenv.mkDerivation rec {
|
|||
# This option is needed for openssl-3 compatibility
|
||||
# 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 install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
|
||||
|
||||
export YARN_ENABLE_TELEMETRY=0
|
||||
mkdir -p ~/.yarn/berry
|
||||
ln -sf $yarnOfflineCache ~/.yarn/berry/cache
|
||||
|
||||
yarn install --immutable --immutable-cache
|
||||
|
||||
patchShebangs ~/bin
|
||||
patchShebangs ~/node_modules
|
||||
|
@ -69,7 +80,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder \
|
||||
rails assets:precompile
|
||||
yarn cache clean --offline
|
||||
yarn cache clean
|
||||
rm -rf ~/node_modules/.cache
|
||||
|
||||
# Create missing static gzip and brotli files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue