diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-24 00:57:12 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-24 00:57:12 +0100 |
commit | 2ff7e086a363abdf8054f796f3cd5cd93b8af5be (patch) | |
tree | 45bc3b0a46cea8e0fe800c7d10ecd2e596e8db9d /virtual/modules/websites/tools/mastodon/default.nix | |
parent | 159d8ff3f05b0ba7dc65b23f5a7b30ddfc59d13f (diff) | |
download | Nix-2ff7e086a363abdf8054f796f3cd5cd93b8af5be.tar.gz Nix-2ff7e086a363abdf8054f796f3cd5cd93b8af5be.tar.zst Nix-2ff7e086a363abdf8054f796f3cd5cd93b8af5be.zip |
Start purifying mastodon: bundler
Diffstat (limited to 'virtual/modules/websites/tools/mastodon/default.nix')
-rw-r--r-- | virtual/modules/websites/tools/mastodon/default.nix | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/virtual/modules/websites/tools/mastodon/default.nix b/virtual/modules/websites/tools/mastodon/default.nix index 98ab9be..f1a207f 100644 --- a/virtual/modules/websites/tools/mastodon/default.nix +++ b/virtual/modules/websites/tools/mastodon/default.nix | |||
@@ -70,16 +70,18 @@ in { | |||
70 | after = [ "network.target" ]; | 70 | after = [ "network.target" ]; |
71 | 71 | ||
72 | environment.RAILS_ENV = "production"; | 72 | environment.RAILS_ENV = "production"; |
73 | environment.BUNDLE_PATH = "${mastodon.gems}/lib/ruby/gems/2.5.0"; | ||
74 | environment.BUNDLE_GEMFILE = "${mastodon.gems.confFiles}/Gemfile"; | ||
73 | environment.SOCKET = mastodon.railsSocket; | 75 | environment.SOCKET = mastodon.railsSocket; |
74 | 76 | ||
75 | path = [ pkgs.bundler pkgs.file ]; | 77 | path = [ mastodon.gems mastodon.gems.ruby pkgs.file ]; |
76 | 78 | ||
77 | preStart = '' | 79 | preStart = '' |
78 | bundle exec rails db:migrate | 80 | ./bin/bundle exec rails db:migrate |
79 | ''; | 81 | ''; |
80 | 82 | ||
81 | script = '' | 83 | script = '' |
82 | exec bundle exec puma -C config/puma.rb | 84 | exec ./bin/bundle exec puma -C config/puma.rb |
83 | ''; | 85 | ''; |
84 | 86 | ||
85 | serviceConfig = { | 87 | serviceConfig = { |
@@ -101,12 +103,14 @@ in { | |||
101 | after = [ "network.target" "mastodon-web.service" ]; | 103 | after = [ "network.target" "mastodon-web.service" ]; |
102 | 104 | ||
103 | environment.RAILS_ENV="production"; | 105 | environment.RAILS_ENV="production"; |
106 | environment.BUNDLE_PATH = "${mastodon.gems}/${mastodon.gems.ruby.gemPath}"; | ||
107 | environment.BUNDLE_GEMFILE = "${mastodon.gems.confFiles}/Gemfile"; | ||
104 | environment.DB_POOL="5"; | 108 | environment.DB_POOL="5"; |
105 | 109 | ||
106 | path = [ pkgs.imagemagick pkgs.ffmpeg pkgs.bundler pkgs.file ]; | 110 | path = [ mastodon.gems mastodon.gems.ruby pkgs.imagemagick pkgs.ffmpeg pkgs.file ]; |
107 | 111 | ||
108 | script = '' | 112 | script = '' |
109 | exec bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push | 113 | exec ./bin/bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push |
110 | ''; | 114 | ''; |
111 | 115 | ||
112 | serviceConfig = { | 116 | serviceConfig = { |
@@ -126,7 +130,7 @@ in { | |||
126 | deps = [ "users" ]; | 130 | deps = [ "users" ]; |
127 | text = '' | 131 | text = '' |
128 | install -m 0755 -o mastodon -g mastodon -d ${mastodon.socketsDir} | 132 | install -m 0755 -o mastodon -g mastodon -d ${mastodon.socketsDir} |
129 | install -m 0755 -o mastodon -g mastodon -d ${mastodon.varDir} | 133 | install -m 0755 -o mastodon -g mastodon -d ${mastodon.varDir} ${mastodon.varDir}/tmp/cache |
130 | ''; | 134 | ''; |
131 | }; | 135 | }; |
132 | 136 | ||