]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/mastodon/mastodon.nix
Temporarily fix mastodon package
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / mastodon / mastodon.nix
index ae2a3f609c179f587b3d57c8e942d4b2d9e461f3..bc4014d1bf5d432f532427862c697fadc962f344 100644 (file)
@@ -4,7 +4,10 @@ let
   socketsDir = "/run/mastodon";
   gems = bundlerEnv {
     name = "mastodon-env";
-    ruby = ruby_2_5;
+    # https://git.immae.eu/mantisbt/view.php?id=131
+    ruby = ruby_2_5.overrideAttrs(old: {
+      postInstall = builtins.replaceStrings [" --destdir $GEM_HOME"] [""] old.postInstall;
+    });
     gemset = ./gemset.nix;
     gemdir = (fetchedGithub ./mastodon.json).src;
     groups = [ "default" "production" "test" "development" ];
@@ -31,22 +34,20 @@ let
         pkgConfig = {
           uws = {
             postInstall = ''
-              node-gyp rebuild > build_log.txt 2>&1 || true
+              npx node-gyp rebuild > build_log.txt 2>&1 || true
               '';
-            buildInputs = with pkgs; [ nodePackages.node-gyp ];
           };
           node-zopfli = {
             postInstall = ''
-              node-pre-gyp install --fallback-to-build
+              npx node-pre-gyp install --fallback-to-build
               '';
-            buildInputs = with pkgs; [ nodePackages.node-pre-gyp ];
           };
           node-sass = {
             buildInputs = with pkgs; [ libsass python ];
             postInstall = let
               nodeHeaders = pkgs.fetchurl {
                 url = "https://nodejs.org/download/release/v${pkgs.nodejs.version}/node-v${pkgs.nodejs.version}-headers.tar.gz";
-                sha256 = "12zzsf8my43b8qnlacp871ih5vqafl2vlpqp51xp6h3gckn2frwy";
+                sha256 = "16f20ya3ys6w5w6y6l4536f7jrgk4gz46bf71w1r1xxb26a54m32";
               };
             in
               ''
@@ -90,6 +91,8 @@ let
 
     STREAMING_CLUSTER_NUM=1
 
+    RAILS_LOG_LEVEL=warn
+
     # LDAP authentication (optional)
     LDAP_ENABLED=true
     LDAP_HOST=ldap.immae.eu
@@ -117,7 +120,7 @@ let
         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
-        ln -sf ../../../../../../../${varDir}/tmp/cache tmp
+        ln -sf ${varDir}/tmp/cache tmp
         '';
       buildInputs = [ gems gems.ruby pkgs.nodejs pkgs.yarn ];
     };