2023-08-31 01:55:45 +03:00
|
|
|
{ config, pkgs, depot, ... }:
|
2021-10-17 01:11:18 +03:00
|
|
|
let
|
2023-08-31 01:55:45 +03:00
|
|
|
inherit (depot.lib.meta) domain;
|
2021-10-17 01:11:18 +03:00
|
|
|
federation = pkgs.writeText "matrix-federation.json" (builtins.toJSON {
|
|
|
|
"m.server" = "matrix.${domain}:443";
|
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.nginx.virtualHosts."top-level.${domain}".locations = {
|
|
|
|
"= /.well-known/matrix/server".alias = federation;
|
2024-05-29 11:17:49 +03:00
|
|
|
"= /.well-known/matrix/client".return = "302 https://matrix.${domain}/.well-known/matrix/client";
|
2021-10-17 01:11:18 +03:00
|
|
|
};
|
|
|
|
}
|