mastodon
Some checks are pending
Plex Update / update (push) Waiting to run

This commit is contained in:
Vivian 2025-07-10 17:04:41 +02:00
parent 11e544d189
commit 59397eb79f
6 changed files with 276 additions and 222 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, nodejs-slim, bundlerEnv
{ stdenv, nodejs-slim, bundlerEnv, defaultGemConfig
, yarn-berry, callPackage, ruby, writeShellScript
, brotli
, brotli, openssl
}:
let
@ -21,6 +21,16 @@ let
ruby = ruby;
gemset = ./gemset.nix;
gemdir = src;
/*
See:
- https://wiki.nixos.org/wiki/Packaging/Ruby#Adding_a_global_override_for_a_gem
- https://nixos.org/manual/nixpkgs/stable/#gem-specific-configurations-and-workarounds
*/
gemConfig = defaultGemConfig // {
hiredis-client = attrs: {
buildInputs = [ openssl ];
};
};
};
# fetches JS dependencies via yarn based on the lockfile in the source
@ -81,11 +91,11 @@ let
-exec chmod 0444 {} ';'
# Create missing static gzip and brotli files
find public/assets -type f -regextype posix-extended -iregex '.*\.(css|html|js|json|svg)' \
# see: https://git.catgirl.cloud/999eagle/dotfiles-nix/-/blob/5d0da33c4f6b52b48777b404593c68a13e292721/overlay/mastodon/glitch/default.nix#L30
# see: https://code.hackerspace.pl/ar/nibylandia/src/commit/7bbb773554204026644fb98c9463fd15726976e9/pkgs/glitch-soc/modules.nix#L52
find public/assets public/packs -type f -regextype posix-extended -iregex '.*\.(css|html|js|js.map|json|svg)' \
-exec gzip --best --keep --force {} ';' \
-exec brotli --best --keep {} ';'
gzip --best --keep public/packs/report.html
brotli --best --keep public/packs/report.html
runHook postBuild
'';