2021-06-02 20:42:32 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
virtualHosts = {
|
|
|
|
"cyplo.dev" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."= /.well-known/matrix/server".extraConfig =
|
|
|
|
let
|
|
|
|
server = { "m.server" = "cyplo.dev:443"; };
|
|
|
|
in ''
|
|
|
|
add_header Content-Type application/json;
|
|
|
|
return 200 '${builtins.toJSON server}';
|
|
|
|
'';
|
|
|
|
|
|
|
|
locations."= /.well-known/matrix/client".extraConfig =
|
|
|
|
let
|
|
|
|
client = {
|
|
|
|
"m.homeserver" = { "base_url" = "https://cyplo.dev"; };
|
|
|
|
"m.identity_server" = { "base_url" = "https://vector.im"; };
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
add_header Content-Type application/json;
|
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
return 200 '${builtins.toJSON client}';
|
|
|
|
'';
|
|
|
|
|
|
|
|
locations."/".extraConfig = ''
|
|
|
|
return 404;
|
|
|
|
'';
|
|
|
|
|
|
|
|
locations."/_matrix" = {
|
2021-10-30 10:22:04 +01:00
|
|
|
proxyPass = "http://bolty:8008"; # without a trailing /
|
2021-06-02 20:42:32 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|