From 81662d4798fb806522f295a338dc3916d962f57e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 9 Dec 2020 19:54:43 +0100 Subject: [PATCH] nixos/nextcloud: improve error message for invalid `dbpassFile` `file_exists` also returns `FALSE` if the file is in a directory that can't be read by the user. This e.g. happens if permissions for `nixops(1)`-deployment keys aren't configured correctly. This patch improves the error message for invalid files to avoid confusion[1]. [1] https://discourse.nixos.org/t/nixops-deploy-secrets-to-nextcloud/10414/4 --- nixos/modules/services/web-apps/nextcloud.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 53c2ab76fdf..0dad85d681a 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -391,7 +391,9 @@ in { $file = "${c.dbpassFile}"; if (!file_exists($file)) { throw new \RuntimeException(sprintf( - "Cannot start Nextcloud, dbpass file %s set by NixOS doesn't exist!", + "Cannot start Nextcloud, dbpass file %s set by NixOS doesn't seem to " + . "exist! Please make sure that the file exists and has appropriate " + . "permissions for user & group 'nextcloud'!", $file )); }