summaryrefslogtreecommitdiff
path: root/pkgs/webapps/mastodon/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/webapps/mastodon/default.nix')
-rw-r--r--pkgs/webapps/mastodon/default.nix16
1 files changed, 12 insertions, 4 deletions
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 @@
3 ruby_2_6, bundlerEnv, defaultGemConfig, 3 ruby_2_6, bundlerEnv, defaultGemConfig,
4 jq, protobuf, protobufc, pkgconfig, libidn, pam, nodejs, yarn }: 4 jq, protobuf, protobufc, pkgconfig, libidn, pam, nodejs, yarn }:
5let 5let
6 info = mylibs.fetchedGithub ./mastodon.json // {
7 src= runCommand "mastodon-patched" {
8 source = (mylibs.fetchedGithub ./mastodon.json).src;
9 } ''
10 cp -a $source $out
11 chmod -R u+w $out
12 sed -i -e "/fuubar/s/2.4.0/2.4.1/" $out/Gemfile.lock
13 '';
14 };
6 gems = bundlerEnv { 15 gems = bundlerEnv {
7 name = "mastodon-env"; 16 name = "mastodon-env";
8 ruby = ruby_2_6; 17 ruby = ruby_2_6;
9 gemset = ./gemset.nix; 18 gemset = ./gemset.nix;
10 gemdir = (mylibs.fetchedGithub ./mastodon.json).src; 19 gemdir = info.src;
11 groups = [ "default" "production" "test" "development" ]; 20 groups = [ "default" "production" "test" "development" ];
12 gemConfig = defaultGemConfig // { 21 gemConfig = defaultGemConfig // {
13 redis-rack = attrs: { 22 redis-rack = attrs: {
@@ -32,7 +41,6 @@ let
32 }; 41 };
33 }; 42 };
34 yarnModules = let 43 yarnModules = let
35 info = mylibs.fetchedGithub ./mastodon.json;
36 packagejson = runCommand "package.json" { buildInputs = [ jq ]; } '' 44 packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
37 cat ${info.src}/package.json | jq -r '.version = "${info.version}"' > $out 45 cat ${info.src}/package.json | jq -r '.version = "${info.version}"' > $out
38 ''; 46 '';
@@ -55,7 +63,7 @@ let
55 }; 63 };
56 }; 64 };
57 }; 65 };
58 mastodon_with_yarn = stdenv.mkDerivation (mylibs.fetchedGithub ./mastodon.json // rec { 66 mastodon_with_yarn = stdenv.mkDerivation (info // rec {
59 installPhase = '' 67 installPhase = ''
60 cp -a . $out 68 cp -a . $out
61 cp -a ${yarnModules}/node_modules $out 69 cp -a ${yarnModules}/node_modules $out
@@ -75,7 +83,7 @@ stdenv.mkDerivation {
75 cp -a $mastodon_with_yarn $out 83 cp -a $mastodon_with_yarn $out
76 cd $out 84 cd $out
77 chmod u+rwX . public 85 chmod u+rwX . public
78 chmod -R u+rwX config/ 86 chmod -R u+rwX config/ node_modules/
79 sed -i -e 's@^end$@ config.action_mailer.sendmail_settings = { location: ENV.fetch("SENDMAIL_LOCATION", "/usr/sbin/sendmail") }\nend@' config/environments/production.rb 87 sed -i -e 's@^end$@ config.action_mailer.sendmail_settings = { location: ENV.fetch("SENDMAIL_LOCATION", "/usr/sbin/sendmail") }\nend@' config/environments/production.rb
80 RAILS_ENV=production ${gems}/bin/rails assets:precompile 88 RAILS_ENV=production ${gems}/bin/rails assets:precompile
81 rm -rf tmp/cache 89 rm -rf tmp/cache