nix-config/features/synapse-matrix.nix

63 lines
1,008 B
Nix
Raw Normal View History

2024-07-19 13:59:34 +02:00
{
pkgs,
config,
lib,
...
}:
2024-07-15 16:27:23 +02:00
#TODO: implement
2024-07-19 13:59:34 +02:00
let
baseUrl = "talk.hypervirtual.world";
in
2024-07-15 16:27:23 +02:00
{
2024-07-19 13:59:34 +02:00
sops.secrets.matrix-shared-secret = {
sopsFile = ../secrets/matrix.yaml;
format = "yaml";
};
2024-07-18 17:17:01 +02:00
services.matrix-synapse = {
enable = true;
2024-07-18 22:40:20 +02:00
2024-07-18 17:17:01 +02:00
settings = {
2024-07-19 13:59:34 +02:00
serverName = baseUrl;
public_baseurl = baseUrl;
2024-07-19 13:30:13 +02:00
enable_registration = false;
2024-07-18 17:17:01 +02:00
};
2024-07-19 13:28:31 +02:00
configureRedisLocally = true;
2024-07-19 13:26:22 +02:00
2024-07-18 22:40:20 +02:00
extras = [
"systemd"
"postgres"
"url-preview"
"user-search"
];
2024-07-19 13:59:34 +02:00
extraConfigFiles = [ "/run/secrets/matrix-shared-secret" ];
listeners = [
{
port = 8008;
bind_addresses = [ "::1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [
"client"
"federation"
];
compress = true;
}
];
}
];
};
services.postgres = {
enable = true;
package = pkgs.postgresql_15;
2024-07-18 17:17:01 +02:00
};
2024-07-15 16:27:23 +02:00
}