renge/synapse: Migrate to new settings option
This commit is contained in:
parent
a68f13967c
commit
8de4852418
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
synapseCfg = config.services.matrix-synapse;
|
||||
synapseCfg = config.services.matrix-synapse.settings;
|
||||
in
|
||||
{
|
||||
sops.secrets = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# somewhat adapted from https://github.com/NixOS/nixpkgs/pull/59211
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
synapseCfg = config.services.matrix-synapse;
|
||||
synapseCfg = config.services.matrix-synapse.settings;
|
||||
in
|
||||
let
|
||||
config = rec {
|
||||
|
@ -74,5 +74,5 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services.matrix-synapse.app_service_config_files = lib.singleton "${generatedConfig}/registration.yaml";
|
||||
services.matrix-synapse.settings.app_service_config_files = lib.singleton "${generatedConfig}/registration.yaml";
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.matrix-synapse;
|
||||
cfg = config.services.matrix-synapse.settings;
|
||||
|
||||
fqdn = "matrix.sbruder.de";
|
||||
domain = "sbruder.de";
|
||||
|
@ -20,12 +20,14 @@ in
|
|||
|
||||
services.matrix-synapse = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
server_name = domain;
|
||||
public_baseurl = "https://${fqdn}";
|
||||
|
||||
listeners = lib.singleton {
|
||||
port = 8008;
|
||||
bind_address = "127.0.0.1";
|
||||
bind_addresses = [ "127.0.0.1" ];
|
||||
type = "http";
|
||||
tls = false;
|
||||
x_forwarded = true;
|
||||
|
@ -74,10 +76,9 @@ in
|
|||
|
||||
max_upload_size = "50M";
|
||||
|
||||
extraConfig = ''
|
||||
# I’m okay with using matrix.org as trusted key server
|
||||
suppress_key_server_warning: true
|
||||
'';
|
||||
suppress_key_server_warning = true;
|
||||
};
|
||||
|
||||
extraConfigFiles = with config.sops.secrets; [
|
||||
synapse-registration-shared-secret.path
|
||||
|
@ -109,7 +110,7 @@ in
|
|||
listenerCfg = (lib.elemAt cfg.listeners 0);
|
||||
in
|
||||
{
|
||||
proxyPass = "http://${listenerCfg.bind_address}:${toString listenerCfg.port}";
|
||||
proxyPass = "http://${lib.elemAt listenerCfg.bind_addresses 0}:${toString listenerCfg.port}";
|
||||
|
||||
extraConfig = ''
|
||||
client_max_body_size ${cfg.max_upload_size};
|
||||
|
|
|
@ -87,11 +87,11 @@ in
|
|||
}
|
||||
(
|
||||
let
|
||||
listenerCfg = (lib.elemAt config.services.matrix-synapse.listeners 0);
|
||||
listenerCfg = (lib.elemAt config.services.matrix-synapse.settings.listeners 0);
|
||||
in
|
||||
{
|
||||
job_name = "synapse";
|
||||
static_configs = mkStaticTarget "${listenerCfg.bind_address}:${toString listenerCfg.port}";
|
||||
static_configs = mkStaticTarget "${lib.elemAt listenerCfg.bind_addresses 0}:${toString listenerCfg.port}";
|
||||
metrics_path = "/_synapse/metrics";
|
||||
relabel_configs = lib.singleton {
|
||||
target_label = "instance";
|
||||
|
|
Loading…
Reference in a new issue