mastodon:init

This commit is contained in:
Astro 2022-11-30 00:34:54 +01:00
parent 7811d3c444
commit a4474a5f39
2 changed files with 58 additions and 0 deletions

View File

@ -1006,6 +1006,13 @@
./hosts/prometheus
];
};
mastodon = nixosSystem' {
modules = [
self.nixosModules.cluster-options
./hosts/mastodon
];
};
};
nixosModule = self.nixosModules.c3d2;

View File

@ -0,0 +1,51 @@
{ zentralwerk, config, lib, pkgs, ... }:
{
networking.hostName = "mastodon";
c3d2.hq.statistics.enable = true;
deployment = {
mem = 4096;
vcpu = 8;
};
system.stateVersion = "22.11";
services.postgresql.enable = true;
services.mastodon = {
enable = true;
localDomain = "c3d2.social";
smtp.host = "c3d2.social";
smtp.fromAddress = "mail@c3d2.social";
# smtp.authenticate = true;
# smtp.user = secrets.email.smtp-user;
# smtp.passwordFile = "${pkgs.runCommand "smtp-password" {} ''
# echo "${secrets.email.smtp-password}" > $out
# ''}";
extraConfig.WEB_DOMAIN = "c3d2.social";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
virtualHosts."c3d2.social" = {
root = "${config.services.mastodon.package}/public/";
forceSSL = true;
enableACME = true;
locations."/system/".alias = "/var/lib/mastodon/public-system/";
locations."/".tryFiles = "$uri @proxy";
locations."@proxy".proxyPass = "http://unix:/run/mastodon-web/web.socket";
locations."@proxy".proxyWebsockets = true;
locations."/api/v1/streaming/".proxyPass = "http://unix:/run/mastodon-streaming/streaming.socket";
locations."/api/v1/streaming/".proxyWebsockets = true;
};
};
users.groups.mastodon.members = [ config.services.nginx.user ];
}