From b32918012814fcca1c5cd6c815b5565d71e96610 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Thu, 6 Jul 2023 23:03:51 +0200 Subject: nixos/synapse: add option to configure redis automatically --- nixos/modules/services/matrix/synapse.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/matrix/synapse.nix b/nixos/modules/services/matrix/synapse.nix index decf9c42c8482..60ad1fa42bc74 100644 --- a/nixos/modules/services/matrix/synapse.nix +++ b/nixos/modules/services/matrix/synapse.nix @@ -770,6 +770,14 @@ in { NixOps is in use. ''; }; + + configureRedisLocally = lib.mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Whether to automatically configure a local redis server for matrix-synapse. + ''; + }; }; }; @@ -794,6 +802,11 @@ in { } ]; + services.matrix-synapse.settings.redis = lib.mkIf cfg.configureRedisLocally { + enabled = true; + path = config.services.redis.servers.matrix-synapse.unixSocket; + }; + services.matrix-synapse.configFile = configFile; services.matrix-synapse.package = wrapped; @@ -886,6 +899,11 @@ in { ]; }; + services.redis.servers.matrix-synapse = lib.mkIf cfg.configureRedisLocally { + enable = true; + user = "matrix-synapse"; + }; + environment.systemPackages = [ registerNewMatrixUser ]; }; -- cgit 1.4.1