From 9e97c34038231c27a2106a7e6e503dc41fbc1a86 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 30 Nov 2022 01:13:23 +0100 Subject: [PATCH] mastodon: use nixos' mastodon nginx config --- hosts/mastodon/default.nix | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/hosts/mastodon/default.nix b/hosts/mastodon/default.nix index cbd0842e..1ca2690a 100644 --- a/hosts/mastodon/default.nix +++ b/hosts/mastodon/default.nix @@ -23,29 +23,16 @@ # echo "${secrets.email.smtp-password}" > $out # ''}"; - extraConfig.WEB_DOMAIN = "c3d2.social"; + extraConfig = { + ALTERNATE_DOMAINS = lib.concatStringsSep "," [ + "${config.networking.hostName}.serv.zentralwerk.org" + ]; + DEFAULT_LOCALE = "de"; + + }; + + configureNginx = true; }; 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 ]; }