diff --git a/modules/cloud/conduit/heisenbridge.nix b/modules/cloud/conduit/heisenbridge.nix index 0a7bc79..1db1040 100644 --- a/modules/cloud/conduit/heisenbridge.nix +++ b/modules/cloud/conduit/heisenbridge.nix @@ -33,7 +33,7 @@ with lib; { { systemd.services.heisenbridge = { description = "Matrix<->IRC bridge"; - before = [ "matrix-synapse.service" ]; # So the registration file can be used by Synapse + requires = [ "matrix-synapse.service" ]; # So the registration file can be used by Synapse wantedBy = [ "multi-user.target" ]; serviceConfig = rec { diff --git a/modules/cloud/gotosocial/default.nix b/modules/cloud/gotosocial/default.nix index cd17c65..f6cfcb3 100644 --- a/modules/cloud/gotosocial/default.nix +++ b/modules/cloud/gotosocial/default.nix @@ -114,7 +114,7 @@ in WorkingDirectory = "/var/lib/gotosocial"; }; wantedBy = [ "multi-user.target" ]; - requires = [ "minio.service" ]; + requires = [ "minio.service" "postgresql.service" ]; }; }; } diff --git a/modules/cloud/mail/default.nix b/modules/cloud/mail/default.nix index 1d7c513..0232c8d 100644 --- a/modules/cloud/mail/default.nix +++ b/modules/cloud/mail/default.nix @@ -275,6 +275,7 @@ in systemd.services."${name}" = { after = [ "network.target" "traefik-certs-dumper.service" ]; wantedBy = [ "multi-user.target" ]; + requires = [ "postgresql.service" ]; description = "maddy mail server"; documentation = [ diff --git a/nki-personal-do/configuration.nix b/nki-personal-do/configuration.nix index 5a343db..ff15470 100644 --- a/nki-personal-do/configuration.nix +++ b/nki-personal-do/configuration.nix @@ -231,6 +231,7 @@ forceHttps = false; }; cloud.postgresql.databases = [ "outline" ]; + systemd.services.outline.requires = [ "postgresql.service" ]; cloud.traefik.hosts.outline = { host = "wiki.dtth.ch"; port = 18729; }; # GoToSocial diff --git a/nki-personal-do/gitea.nix b/nki-personal-do/gitea.nix index 564568c..0b1d7ce 100644 --- a/nki-personal-do/gitea.nix +++ b/nki-personal-do/gitea.nix @@ -83,6 +83,8 @@ in noCloudflare = true; }; + systemd.services.gitea.requires = [ "postgresql.service" ]; + services.gitea = { enable = true; diff --git a/nki-personal-do/headscale.nix b/nki-personal-do/headscale.nix index b342e11..acb6da1 100644 --- a/nki-personal-do/headscale.nix +++ b/nki-personal-do/headscale.nix @@ -27,6 +27,7 @@ rec { noCloudflare = true; }; + systemd.services.headscale.requires = [ "postgresql.service" ]; services.headscale = { enable = true; inherit port; diff --git a/nki-personal-do/miniflux.nix b/nki-personal-do/miniflux.nix index 283216c..f8157da 100644 --- a/nki-personal-do/miniflux.nix +++ b/nki-personal-do/miniflux.nix @@ -42,7 +42,8 @@ in systemd.services.miniflux = { description = "Miniflux service"; wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "postgresql.service" ]; + after = [ "network.target" ]; + requires = [ "postgresql.service" ]; serviceConfig = { ExecStart = "${package}/bin/miniflux"; diff --git a/nki-personal-do/nextcloud.nix b/nki-personal-do/nextcloud.nix index f0528c5..2bb15f2 100644 --- a/nki-personal-do/nextcloud.nix +++ b/nki-personal-do/nextcloud.nix @@ -16,6 +16,7 @@ in cloud.traefik.hosts.nextcloud = { inherit port host; }; + systemd.services.nextcloud.requires = [ "postgresql.service" ]; services.nextcloud = { enable = true; hostName = host; diff --git a/nki-personal-do/synapse.nix b/nki-personal-do/synapse.nix index 070aab0..f3657a7 100644 --- a/nki-personal-do/synapse.nix +++ b/nki-personal-do/synapse.nix @@ -23,6 +23,8 @@ in }; # Synapse instance for DTTH + systemd.services.matrix-synapse.requires = [ "postgresql.service" ]; + services.matrix-synapse = { enable = true; withJemalloc = true;