{ config, lib, pkgs, ... }: { config = lib.mkIf config.system.socialserver.enable { services.mastodon = { enable = true; localDomain = "social.${config.domains.p2}"; streamingProcesses = 4; configureNginx = true; smtp = { createLocally = false; host = "mx.${config.domains.p2}"; port = 587; authenticate = true; fromAddress = "NixFox Mastodon "; user = "noreply@${config.domains.p2}"; passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword; }; }; environment.persistence."/persist".directories = [ "/var/lib/mastodon" ]; }; }