]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/mastodon/mastodon.nix
Adjust journald configuration and limit some verbose apps
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / mastodon / mastodon.nix
index 770aa2cb5b584cf3157ae92a7116206a4a032c85..5f0104c5da7a7b0e16f909ba1c80ee0b93bf2a57 100644 (file)
@@ -42,7 +42,7 @@ let
             buildInputs = with pkgs; [ nodePackages.node-pre-gyp ];
           };
           node-sass = {
-            buildInputs = with pkgs; [ binutils libsass python ];
+            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";
@@ -50,7 +50,6 @@ let
               };
             in
               ''
-                export AR=${pkgs.binutils.bintools}/bin/ar
                 node scripts/build.js --tarball=${nodeHeaders}
               '';
           };
@@ -84,14 +83,15 @@ let
     VAPID_PRIVATE_KEY=${env.vapid.private}
     VAPID_PUBLIC_KEY=${env.vapid.public}
 
-    SMTP_SERVER=mail.immae.eu
-    SMTP_PORT=587
+    SMTP_DELIVERY_METHOD=sendmail
     SMTP_FROM_ADDRESS=notifications@mastodon.immae.eu
-    SMTP_DELIVERY_METHOD=smtp
+    SENDMAIL_LOCATION="/run/wrappers/bin/sendmail"
     PAPERCLIP_ROOT_PATH=${varDir}
 
     STREAMING_CLUSTER_NUM=1
 
+    RAILS_LOG_LEVEL=warn
+
     # LDAP authentication (optional)
     LDAP_ENABLED=true
     LDAP_HOST=ldap.immae.eu
@@ -115,6 +115,8 @@ let
         cp -a $mastodon $out
         cd $out
         chmod u+rwX . public
+        chmod -R u+rwX config/
+        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