after = [ "network.target" ];
environment.RAILS_ENV = "production";
+ environment.BUNDLE_PATH = "${mastodon.gems}/lib/ruby/gems/2.5.0";
+ environment.BUNDLE_GEMFILE = "${mastodon.gems.confFiles}/Gemfile";
environment.SOCKET = mastodon.railsSocket;
- path = [ pkgs.bundler pkgs.file ];
+ path = [ mastodon.gems mastodon.gems.ruby pkgs.file ];
preStart = ''
- bundle exec rails db:migrate
+ ./bin/bundle exec rails db:migrate
'';
script = ''
- exec bundle exec puma -C config/puma.rb
+ exec ./bin/bundle exec puma -C config/puma.rb
'';
serviceConfig = {
after = [ "network.target" "mastodon-web.service" ];
environment.RAILS_ENV="production";
+ environment.BUNDLE_PATH = "${mastodon.gems}/${mastodon.gems.ruby.gemPath}";
+ environment.BUNDLE_GEMFILE = "${mastodon.gems.confFiles}/Gemfile";
environment.DB_POOL="5";
- path = [ pkgs.imagemagick pkgs.ffmpeg pkgs.bundler pkgs.file ];
+ path = [ mastodon.gems mastodon.gems.ruby pkgs.imagemagick pkgs.ffmpeg pkgs.file ];
script = ''
- exec bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
+ exec ./bin/bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
'';
serviceConfig = {
deps = [ "users" ];
text = ''
install -m 0755 -o mastodon -g mastodon -d ${mastodon.socketsDir}
- install -m 0755 -o mastodon -g mastodon -d ${mastodon.varDir}
+ install -m 0755 -o mastodon -g mastodon -d ${mastodon.varDir} ${mastodon.varDir}/tmp/cache
'';
};