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";
|
2024-07-06 14:29:44 +02:00
|
|
|
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."/" = {
|
2024-07-06 13:57:46 +02:00
|
|
|
recommendedProxySettings = true;
|
|
|
|
proxyWebsockets = true;
|
2024-07-06 09:23:24 +02:00
|
|
|
proxyPass = "http://${gtsConfig.bind-address}:${builtins.toString gtsConfig.port}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|