nixos/synapse: document options better

Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com>
This commit is contained in:
Sophie Tauchert 2023-07-07 11:55:10 +02:00 committed by Sophie Tauchert
parent b20cbb12cd
commit 2edea7611b
No known key found for this signature in database
GPG Key ID: 52701DE5F5F51125
2 changed files with 50 additions and 3 deletions

View File

@ -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" ];
}];
}
];
};
}
'';
};
};
};

View File

@ -37,9 +37,7 @@ import ../make-test-python.nix ({ pkgs, ... }: {
workers = {
enable = true;
config = {
"federation_sender" = {
worker_app = "synapse.app.generic_worker";
};
"federation_sender" = { };
};
};
};