nixos-config/configurations/camelot/gotosocial.nix
2024-07-06 14:22:52 +02:00

43 lines
1,001 B
Nix

{ config, ... }:
let
wellKnownLocations = [
"/.well-known/webfinger"
"/.well-known/host-meta"
"/.well-known/nodeinfo"
];
gtsConfig = config.services.gotosocial.settings;
in
{
services.gotosocial = {
enable = true;
openFirewall = false;
setupPostgresqlDB = true;
settings = {
application-name = "Dala's personnal instance";
host = "gts.dalaran.fr";
account-domain = "dalaran.fr";
bind-address = "localhost";
};
};
services.nginx.virtualHosts = {
"dalaran.fr".locations = builtins.listToAttrs (
map (location: {
name = location;
value.return = "301 https://gts.dalaran.fr$request_uri";
}) wellKnownLocations
);
"gts.dalaran.fr" = {
enableACME = true;
forceSSL = true;
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://${gtsConfig.bind-address}:${builtins.toString gtsConfig.port}";
};
};
};
}