-{ lib, pkgs, config, mylibs, ... }:
+{ lib, pkgs, config, myconfig, mylibs, ... }:
let
mastodon = pkgs.callPackage ./mastodon.nix {
- inherit (mylibs) fetchedGithub checkEnv;
+ inherit (mylibs) fetchedGithub;
+ env = myconfig.env.tools.mastodon;
};
cfg = config.services.myWebsites.tools.mastodon;
};
config = lib.mkIf cfg.enable {
- # FIXME: Can we use dynamic users from systemd?
- # nixos/modules/misc/ids.nix
ids.uids.mastodon = 399;
ids.gids.mastodon = 399;
EnvironmentFile = mastodon.config;
PrivateTmp = true;
Restart = "always";
- TimeoutSec = 15;
+ TimeoutSec = 60;
Type = "simple";
WorkingDirectory = mastodon.railsRoot;
};
environment.RAILS_ENV="production";
environment.DB_POOL="5";
- path = [ pkgs.bundler pkgs.file ];
+ path = [ pkgs.imagemagick pkgs.ffmpeg pkgs.bundler pkgs.file ];
script = ''
exec bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
unitConfig.RequiresMountsFor = mastodon.varDir;
};
- # FIXME: initial sync
system.activationScripts.mastodon = {
deps = [ "users" ];
text = ''
services.myWebsites.tools.modules = [
"headers" "proxy" "proxy_wstunnel" "proxy_http" "proxy_balancer"
- # FIXME: probably only one balancer method is needed:
"lbmethod_byrequests" "lbmethod_bytraffic" "lbmethod_bybusyness" "lbmethod_heartbeat"
];
security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null;