summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 7e464d6ed589..7caac6038292 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";
};
};
};