From 34da0bd4fc7a80495bc5725a775befea0b0e132c Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 19 Mar 2025 21:36:59 +0100 Subject: [PATCH] nixos/nextcloud: Also install when config.php exists but is empty Running any occ command will create an empty config file automatically: https://github.com/nextcloud/server/blob/f85154f1e1a3bfcf022cd1833a3028ea9c63380e/lib/base.php#L194-L196 This causes the current check to never execute the installation, in case any occ command was run before it (which itself fails because Nextcloud is not installled yet). So any services which don't properly depend on nextcloud-setup.service cause Nextcloud to never be installed. --- nixos/modules/services/web-apps/nextcloud.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index de6ebeaf5170..ed436dad32e0 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -1058,7 +1058,7 @@ in { '') [ "nix-apps" "apps" ]} # Do not install if already installed - if [[ ! -e ${datadir}/config/config.php ]]; then + if [[ ! -s ${datadir}/config/config.php ]]; then ${occInstallCmd} fi