summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSophie Tauchert <sophie@999eagle.moe>2023-11-05 21:38:38 +0100
committerSophie Tauchert <sophie@999eagle.moe>2023-11-05 21:38:39 +0100
commit70dc536ae0b3c461651599a0853c0484913fd34d (patch)
treeeb667d25275010d8de18d55618cf42d50a9e8af7 /nixos
parentc8b55396268b9a6f053b7eca85a88d232684aace (diff)
downloadnixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar.gz
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar.bz2
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar.lz
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar.xz
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.tar.zst
nixpkgs-70dc536ae0b3c461651599a0853c0484913fd34d.zip
nixos/matrix-synapse: add readOnly serviceUnit option
This is useful to configure services dependent on matrix-synapse regardless
of whether workers are enabled or not.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/matrix/synapse.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/services/matrix/synapse.nix b/nixos/modules/services/matrix/synapse.nix
index 12e27ef26ff..9cc769c2d0d 100644
--- a/nixos/modules/services/matrix/synapse.nix
+++ b/nixos/modules/services/matrix/synapse.nix
@@ -296,6 +296,18 @@ in {
     services.matrix-synapse = {
       enable = mkEnableOption (lib.mdDoc "matrix.org synapse");
 
+      serviceUnit = lib.mkOption {
+        type = lib.types.str;
+        readOnly = true;
+        description = lib.mdDoc ''
+          The systemd unit (a service or a target) for other services to depend on if they
+          need to be started after matrix-synapse.
+
+          This option is useful as the actual parent unit for all matrix-synapse processes
+          changes when configuring workers.
+        '';
+      };
+
       configFile = mkOption {
         type = types.path;
         readOnly = true;
@@ -1021,6 +1033,7 @@ in {
       port = 9093;
     });
 
+    services.matrix-synapse.serviceUnit = if hasWorkers then "matrix-synapse.target" else "matrix-synapse.service";
     services.matrix-synapse.configFile = configFile;
     services.matrix-synapse.package = wrapped;