From 2edea7611bff66697e1aa5f5b8921a5be9d3e6a6 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Fri, 7 Jul 2023 11:55:10 +0200 Subject: [PATCH] nixos/synapse: document options better Co-authored-by: Daniel Olsen --- nixos/modules/services/matrix/synapse.nix | 49 +++++++++++++++++++++++ nixos/tests/matrix/synapse-workers.nix | 4 +- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/matrix/synapse.nix b/nixos/modules/services/matrix/synapse.nix index c779105abf25..52074f1d9a62 100644 --- a/nixos/modules/services/matrix/synapse.nix +++ b/nixos/modules/services/matrix/synapse.nix @@ -761,6 +761,28 @@ in { ''; }; + redis = lib.mkOption { + type = types.submodule { + freeformType = format.type; + options = { + enabled = lib.mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Whether to use redis support + ''; + }; + }; + }; + default = { }; + description = lib.mdDoc '' + Redis configuration for synapse. + + See the + [upstream documentation](https://github.com/matrix-org/synapse/blob/v${pkgs.matrix-synapse-unwrapped.version}/usage/configuration/config_documentation.md#redis) + for available options. + ''; + }; }; }; }; @@ -795,6 +817,14 @@ in { type = types.attrsOf (types.submodule { freeformType = format.type; options = { + worker_app = lib.mkOption { + type = types.enum [ + "synapse.app.generic_worker" + "synapse.app.media_repository" + ]; + description = "Type of this worker"; + default = "synapse.app.generic_worker"; + }; worker_listeners = lib.mkOption { default = [ ]; type = types.listOf listenerType; @@ -810,6 +840,25 @@ in { [worker documention](https://matrix-org.github.io/synapse/latest/workers.html#worker-configuration) for possible values. ''; + example = lib.literalExpression '' + { + "federation_sender" = { }; + "federation_receiver" = { + worker_listeners = [ + { + type = "http"; + port = 8009; + bind_addresses = [ "127.0.0.1" ]; + tls = false; + x_forwarded = true; + resources = [{ + names = [ "federation" ]; + }]; + } + ]; + }; + } + ''; }; }; }; diff --git a/nixos/tests/matrix/synapse-workers.nix b/nixos/tests/matrix/synapse-workers.nix index a08b326abe62..fb722037c3e2 100644 --- a/nixos/tests/matrix/synapse-workers.nix +++ b/nixos/tests/matrix/synapse-workers.nix @@ -37,9 +37,7 @@ import ../make-test-python.nix ({ pkgs, ... }: { workers = { enable = true; config = { - "federation_sender" = { - worker_app = "synapse.app.generic_worker"; - }; + "federation_sender" = { }; }; }; };