diff options
author | Rory& <root@rory.gay> | 2024-08-16 12:16:21 +0200 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-08-16 12:16:21 +0200 |
commit | 9778db57511950cda9d5c0f8955597d6b2282302 (patch) | |
tree | e946d27d44b425986240dd731afea7944894df1a /host/Rory-nginx/services/matrix/synapse/workers/module.nix | |
parent | Nginx log request times (diff) | |
download | Rory-Open-Architecture-9778db57511950cda9d5c0f8955597d6b2282302.tar.xz |
Some synapse workers cleanup
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/workers/module.nix')
-rw-r--r-- | host/Rory-nginx/services/matrix/synapse/workers/module.nix | 114 |
1 files changed, 41 insertions, 73 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/workers/module.nix b/host/Rory-nginx/services/matrix/synapse/workers/module.nix index bb46aed..ca6aaec 100644 --- a/host/Rory-nginx/services/matrix/synapse/workers/module.nix +++ b/host/Rory-nginx/services/matrix/synapse/workers/module.nix @@ -1,12 +1,20 @@ { config, lib, ... }: let cfg = config.services.matrix-synapse; + mkIntOption = + description: + lib.mkOption { + type = lib.types.int; + default = 0; + description = description; + }; in - { imports = [ - ./appservice.nix - ./background.nix + ./single/appservice.nix + ./single/background.nix + ./single/user-dir.nix + ./auth.nix ./client-reader.nix ./federation-inbound.nix ./federation-reader.nix @@ -14,86 +22,46 @@ in ./media-repo.nix ./pusher.nix ./sync.nix - ./user-dir.nix ./stream-writers/event-stream-writer.nix ]; - options.services.matrix-synapse = - lib.listToAttrs ( - lib.map - (option: { - name = "${option}StreamWriters"; - value = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of writers for ${option} streams"; - }; - }) - [ - "event" - "typing" - "toDevice" - "accountData" - "receipts" - "presence" - "pushRule" - ] - ) - // { - enableWorkers = lib.mkEnableOption "Enable dedicated workers"; - enableStreamWriters = lib.mkEnableOption "Enable stream writers"; - enableAppserviceWorker = lib.mkEnableOption "Enable dedicated appservice worker"; - enableBackgroundWorker = lib.mkEnableOption "Enable dedicated background task worker"; - enableUserDirWorker = lib.mkEnableOption "Enable dedicated user directory worker"; + options.services.matrix-synapse = { + enableWorkers = lib.mkEnableOption "Enable dedicated workers"; + enableStreamWriters = lib.mkEnableOption "Enable stream writers"; + enableAppserviceWorker = lib.mkEnableOption "Enable dedicated appservice worker"; + enableBackgroundWorker = lib.mkEnableOption "Enable dedicated background task worker"; + enableUserDirWorker = lib.mkEnableOption "Enable dedicated user directory worker"; - federationSenders = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of federation senders"; - }; - pushers = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of pushers"; - }; - mediaRepoWorkers = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of media repo workers"; - }; - syncWorkers = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of sync workers"; - }; - clientReaders = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of client readers"; - }; - federationReaders = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of federation readers"; - }; - federationInboundWorkers = lib.mkOption { - type = lib.types.int; - default = 0; - description = "Number of federation inbound workers"; - }; + authWorkers = mkIntOption "Number of auth workers"; + federationSenders = mkIntOption "Number of federation senders"; + pushers = mkIntOption "Number of pushers"; + mediaRepoWorkers = mkIntOption "Number of media repo workers"; + syncWorkers = mkIntOption "Number of sync workers"; + clientReaders = mkIntOption "Number of client readers"; + federationReaders = mkIntOption "Number of federation readers"; + federationInboundWorkers = mkIntOption "Number of federation inbound workers"; - nginxVirtualHostName = lib.mkOption { - type = lib.types.str; - default = null; - description = "The virtual host name for the nginx server"; - }; + #stream writers + eventStreamWriters = mkIntOption "Number of event stream writers"; + typingStreamWriters = mkIntOption "Number of typing stream writers"; + toDeviceStreamWriters = mkIntOption "Number of to_device stream writers"; + accountDataStreamWriters = mkIntOption "Number of account data stream writers"; + receiptsStreamWriters = mkIntOption "Number of read receipt stream writers"; + presenceStreamWriters = mkIntOption "Number of presence stream writers"; + pushRuleStreamWriters = mkIntOption "Number of push rule stream writers"; + + nginxVirtualHostName = lib.mkOption { + type = lib.types.str; + default = null; + description = "The virtual host name for the nginx server"; }; + }; config = { assertions = [ { - assertion = cfg.enableUserDirWorker -> cfg.nginxVirtualHostName != null; - message = "nginxVirtualHostName must be set when enableUserDirWorker is true"; + assertion = cfg.enableWorkers -> cfg.nginxVirtualHostName != null; + message = "nginxVirtualHostName must be set when enableWorkers is true"; } ]; }; |