X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix%2FNUR.git;a=blobdiff_plain;f=pkgs%2Fwebapps%2Fmastodon%2Fdefault.nix;h=3769b67fd899891110910acfa87190413b659dd0;hp=12e4c2c8343a53e0e212c09a0b01d8437f80a542;hb=9d9610d708ac75f04c0876460d803c0cc18a0ef4;hpb=17eabf477b035ff4590640ebdfd69ca558437c51 diff --git a/pkgs/webapps/mastodon/default.nix b/pkgs/webapps/mastodon/default.nix index 12e4c2c8..3769b67f 100644 --- a/pkgs/webapps/mastodon/default.nix +++ b/pkgs/webapps/mastodon/default.nix @@ -3,11 +3,20 @@ ruby_2_6, bundlerEnv, defaultGemConfig, jq, protobuf, protobufc, pkgconfig, libidn, pam, nodejs, yarn }: let + info = mylibs.fetchedGithub ./mastodon.json // { + src= runCommand "mastodon-patched" { + source = (mylibs.fetchedGithub ./mastodon.json).src; + } '' + cp -a $source $out + chmod -R u+w $out + sed -i -e "/fuubar/s/2.4.0/2.4.1/" $out/Gemfile.lock + ''; + }; gems = bundlerEnv { name = "mastodon-env"; ruby = ruby_2_6; gemset = ./gemset.nix; - gemdir = (mylibs.fetchedGithub ./mastodon.json).src; + gemdir = info.src; groups = [ "default" "production" "test" "development" ]; gemConfig = defaultGemConfig // { redis-rack = attrs: { @@ -32,7 +41,6 @@ let }; }; yarnModules = let - info = mylibs.fetchedGithub ./mastodon.json; packagejson = runCommand "package.json" { buildInputs = [ jq ]; } '' cat ${info.src}/package.json | jq -r '.version = "${info.version}"' > $out ''; @@ -55,7 +63,7 @@ let }; }; }; - mastodon_with_yarn = stdenv.mkDerivation (mylibs.fetchedGithub ./mastodon.json // rec { + mastodon_with_yarn = stdenv.mkDerivation (info // rec { installPhase = '' cp -a . $out cp -a ${yarnModules}/node_modules $out @@ -75,7 +83,7 @@ stdenv.mkDerivation { cp -a $mastodon_with_yarn $out cd $out chmod u+rwX . public - chmod -R u+rwX config/ + chmod -R u+rwX config/ node_modules/ sed -i -e 's@^end$@ config.action_mailer.sendmail_settings = { location: ENV.fetch("SENDMAIL_LOCATION", "/usr/sbin/sendmail") }\nend@' config/environments/production.rb RAILS_ENV=production ${gems}/bin/rails assets:precompile rm -rf tmp/cache