nixos-config/configurations/camelot/gotosocial.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2024-07-06 09:23:24 +02:00
{ config, ... }:
let
wellKnownLocations = [
"/.well-known/webfinger"
"/.well-known/host-meta"
"/.well-known/nodeinfo"
];
gtsConfig = config.services.gotosocial.settings;
in
{
services.gotosocial = {
enable = true;
2024-07-06 14:15:07 +02:00
openFirewall = false;
2024-07-06 09:23:24 +02:00
setupPostgresqlDB = true;
settings = {
2024-07-06 14:15:07 +02:00
application-name = "Dala's personnal instance";
landing-page-user = "dala";
2024-07-06 09:23:24 +02:00
host = "gts.dalaran.fr";
account-domain = "dalaran.fr";
bind-address = "localhost";
2024-07-06 19:55:52 +02:00
instance-languages = [
"en"
"fr"
];
2024-07-06 09:23:24 +02:00
};
};
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;
2024-07-06 09:23:24 +02:00
proxyPass = "http://${gtsConfig.bind-address}:${builtins.toString gtsConfig.port}";
};
};
};
}