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: {
};
};
yarnModules = let
- info = mylibs.fetchedGithub ./mastodon.json;
packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
cat ${info.src}/package.json | jq -r '.version = "${info.version}"' > $out
'';
};
};
};
- mastodon_with_yarn = stdenv.mkDerivation (mylibs.fetchedGithub ./mastodon.json // rec {
- installPhase = ''
- cp -a . $out
- cp -a ${yarnModules}/node_modules $out
- '';
- buildInputs = [ yarnModules ];
- });
+ mastodon_with_yarn = stdenv.mkDerivation (info // rec {
+ installPhase = ''
+ cp -a . $out
+ cp -a ${yarnModules}/node_modules $out
+ '';
+ buildInputs = [ yarnModules ];
+ });
in
stdenv.mkDerivation {
name = "mastodon";
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