about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorSophie Tauchert <sophie@999eagle.moe>2023-11-02 19:41:52 +0100
committerSophie Tauchert <sophie@999eagle.moe>2023-11-05 21:31:20 +0100
commitc8b55396268b9a6f053b7eca85a88d232684aace (patch)
tree50148658fe514c14d71dd770fc03f229929c0182 /nixos/modules
parent0cbe9f69c234a7700596e943bfae7ef27a31b735 (diff)
nixos/matrix-sliding-sync: add dependency on matrix-synapse if running locally and restart
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/matrix/matrix-sliding-sync.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/nixos/modules/services/matrix/matrix-sliding-sync.nix b/nixos/modules/services/matrix/matrix-sliding-sync.nix
index 7e464d6ed5898..7caac6038292a 100644
--- a/nixos/modules/services/matrix/matrix-sliding-sync.nix
+++ b/nixos/modules/services/matrix/matrix-sliding-sync.nix
@@ -80,8 +80,11 @@ in
       } ];
     };
 
-    systemd.services.matrix-sliding-sync = {
-      after = lib.optional cfg.createDatabase "postgresql.service";
+    systemd.services.matrix-sliding-sync = rec {
+      after =
+        lib.optional cfg.createDatabase "postgresql.service"
+        ++ lib.optional config.services.matrix-synapse.enable "matrix-synapse.service";
+      wants = after;
       wantedBy = [ "multi-user.target" ];
       environment = cfg.settings;
       serviceConfig = {
@@ -90,6 +93,8 @@ in
         ExecStart = lib.getExe cfg.package;
         StateDirectory = "matrix-sliding-sync";
         WorkingDirectory = "%S/matrix-sliding-sync";
+        Restart = "on-failure";
+        RestartSec = "1s";
       };
     };
   };