modules: services: matrix: use 'settings'
The unstructured attributes are hard-deprecated.
This commit is contained in:
parent
ba6c8bff2e
commit
0db2c0a13c
|
@ -19,10 +19,10 @@ in
|
||||||
options.my.services.matrix = with lib; {
|
options.my.services.matrix = with lib; {
|
||||||
enable = mkEnableOption "Matrix Synapse";
|
enable = mkEnableOption "Matrix Synapse";
|
||||||
|
|
||||||
secret = mkOption {
|
secretFile = mkOption {
|
||||||
type = with types; nullOr str;
|
type = with types; nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "deadbeef";
|
example = "/var/lib/matrix/shared-secret-config.yaml";
|
||||||
description = "Shared secret to register users";
|
description = "Shared secret to register users";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,42 +50,46 @@ in
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "/var/lib/matrix-synapse";
|
dataDir = "/var/lib/matrix-synapse";
|
||||||
server_name = domain;
|
|
||||||
public_baseurl = "https://matrix.${domain}";
|
|
||||||
|
|
||||||
enable_registration = false;
|
settings = {
|
||||||
registration_shared_secret = cfg.secret;
|
server_name = domain;
|
||||||
|
public_baseurl = "https://matrix.${domain}";
|
||||||
|
|
||||||
listeners = [
|
enable_registration = false;
|
||||||
# Federation
|
# registration_shared_secret = cfg.secret; # FIXME: use a secret file for this
|
||||||
{
|
|
||||||
bind_address = "::1";
|
|
||||||
port = federationPort.private;
|
|
||||||
tls = false; # Terminated by nginx.
|
|
||||||
x_forwarded = true;
|
|
||||||
resources = [{ names = [ "federation" ]; compress = false; }];
|
|
||||||
}
|
|
||||||
|
|
||||||
# Client
|
listeners = [
|
||||||
{
|
# Federation
|
||||||
bind_address = "::1";
|
{
|
||||||
port = clientPort.private;
|
bind_addresses = [ "::1" ];
|
||||||
tls = false; # Terminated by nginx.
|
port = federationPort.private;
|
||||||
x_forwarded = true;
|
tls = false; # Terminated by nginx.
|
||||||
resources = [{ names = [ "client" ]; compress = false; }];
|
x_forwarded = true;
|
||||||
}
|
resources = [{ names = [ "federation" ]; compress = false; }];
|
||||||
];
|
}
|
||||||
|
|
||||||
account_threepid_delegates.msisdn = "https://vector.im";
|
# Client
|
||||||
|
{
|
||||||
|
bind_addresses = [ "::1" ];
|
||||||
|
port = clientPort.private;
|
||||||
|
tls = false; # Terminated by nginx.
|
||||||
|
x_forwarded = true;
|
||||||
|
resources = [{ names = [ "client" ]; compress = false; }];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
account_threepid_delegates = {
|
||||||
experimental_features:
|
msisdn = "https://vector.im";
|
||||||
spaces_enabled: true
|
};
|
||||||
'';
|
|
||||||
|
experimental_features = {
|
||||||
|
spaces_enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
extraConfigFiles = [
|
extraConfigFiles = [
|
||||||
cfg.mailConfigFile
|
cfg.mailConfigFile
|
||||||
];
|
] ++ lib.optional (cfg.secretFile != null) cfg.secretFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = [
|
my.services.nginx.virtualHosts = [
|
||||||
|
|
Loading…
Reference in a new issue