]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/blobdiff - pkgs/webapps/mastodon/default.nix
Upgrade mastodon
[perso/Immae/Config/Nix/NUR.git] / pkgs / webapps / mastodon / default.nix
index 12e4c2c8343a53e0e212c09a0b01d8437f80a542..3769b67fd899891110910acfa87190413b659dd0 100644 (file)
@@ -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