From 64faf49d6faba88117606be83b09f61c807cb2cb Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 1 Sep 2022 12:56:45 -0300 Subject: nixos/nextcloud: wait for postgresql.service When configured with `dbtype = "pgsql"`, the `nextcloud-setup` service should require that `postgresql.service` be running in order to run, otherwise it fails to connect to the DB and craps out. --- nixos/modules/services/web-apps/nextcloud.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index fdbaa90ebb7a..9fba4118e152 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -841,6 +841,8 @@ in { in { wantedBy = [ "multi-user.target" ]; before = [ "phpfpm-nextcloud.service" ]; + after = optional (cfg.config.dbtype == "pgsql") "postgresql.service"; + requires = optional (cfg.config.dbtype == "pgsql") "postgresql.service"; path = [ occ ]; script = '' ${optionalString (c.dbpassFile != null) '' -- cgit v1.2.3