M host-configurations/nevarro.nix => host-configurations/nevarro.nix +19 -3
@@ 1,4 1,4 @@
-{ config, lib, ... }: {
+{ config, lib, ... }: with lib; {
hardware.isServer = true;
# Set the hostname
@@ 70,7 70,23 @@
services.standupbot.passwordFile = "/etc/nixos/secrets/matrix/bots/standupbot";
# Synapse
- services.matrix-synapse-custom.enable = true;
- services.matrix-synapse-custom.registrationSharedSecretFile = ../secrets/matrix/registration-shared-secret/nevarro;
+ services.matrix-synapse-custom = {
+ enable = true;
+ registrationSharedSecretFile = ../secrets/matrix/registration-shared-secret/nevarro;
+ emailCfg = {
+ smtp_host = "smtp.migadu.com";
+ smtp_port = 587;
+ require_transport_security = true;
+
+ smtp_user = "matrix@nevarro.space";
+ smtp_pass = removeSuffix "\n" (readFile ../secrets/matrix/nevarro-smtp-pass);
+
+ notif_from = "Nevarro %(app)s Admin <matrix@nevarro.space>";
+ app_name = "Matrix";
+ enable_notifs = true;
+ notif_for_new_users = false;
+ invite_client_location = "https://app.element.io";
+ };
+ };
services.cleanup-synapse.environmentFile = "/etc/nixos/secrets/matrix/cleanup-synapse/bespin";
}
M modules/services/matrix/synapse/default.nix => modules/services/matrix/synapse/default.nix +6 -0
@@ 171,6 171,12 @@ in
The path to a file that contains the shared registration secret.
'';
};
+
+ emailCfg = mkOption {
+ type = with types; attrsOf anything;
+ default = { };
+ description = "The email configuration.";
+ };
};
};
M modules/services/matrix/synapse/shared-config.nix => modules/services/matrix/synapse/shared-config.nix +3 -2
@@ 21,13 21,13 @@ let
root = { level = "INFO"; handlers = [ "journal" ]; };
disable_existing_loggers = false;
};
-
in
{
# Server
server_name = config.networking.domain;
pid_file = "/run/matrix-synapse.pid";
default_room_version = "9";
+ public_baseurl = "https://matrix.${config.networking.domain}";
listeners = [
# CS API and Federation
{
@@ 124,7 124,8 @@ in
];
suppress_key_server_warning = true;
- # TODO email?
+ # Email
+ email = cfg.emailCfg;
# Workers
send_federation = false;
A secrets/matrix/nevarro-smtp-pass => secrets/matrix/nevarro-smtp-pass +0 -0