summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2022-09-01 12:56:45 -0300
committerBernardo Meurer <bernardo@meurer.org>2022-09-01 12:59:14 -0300
commit64faf49d6faba88117606be83b09f61c807cb2cb (patch)
treeadd3fe68c478d0231c02769ecd7f78f0c4effa7b
parentMerge pull request #188916 from tathougies/patch-4 (diff)
downloadnixpkgs-origin/nextcloud-postgres-wait.tar.gz
nixos/nextcloud: wait for postgresql.serviceorigin/nextcloud-postgres-wait
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.
-rw-r--r--nixos/modules/services/web-apps/nextcloud.nix2
1 files changed, 2 insertions, 0 deletions
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) ''