From 23468ad19f19f77f17de3502c963f3120877b14c Mon Sep 17 00:00:00 2001 From: networkException Date: Sat, 10 May 2025 20:36:01 +0200 Subject: [PATCH] nixos/nextcloud: use LoadCredential to read services.nextcloud.secretFile This patch adds support for using systemd's LoadCredential feature to read in a json file at a path defined in the services.nextcloud.secretFile option. This is a follow up to 2ce1e841032eac4913f2cd3dce416da3d5c799ef. --- nixos/modules/services/web-apps/nextcloud.nix | 25 +++++++++++++------ .../with-declarative-redis-and-secrets.nix | 13 +++++----- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 65845156fc49..0a6647e0cab7 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -116,7 +116,8 @@ let ++ (lib.optional (cfg.config.objectstore.s3.enable) "s3_secret:${cfg.config.objectstore.s3.secretFile}") ++ (lib.optional ( cfg.config.objectstore.s3.sseCKeyFile != null - ) "s3_sse_c_key:${cfg.config.objectstore.s3.sseCKeyFile}"); + ) "s3_sse_c_key:${cfg.config.objectstore.s3.sseCKeyFile}") + ++ (lib.optional (cfg.secretFile != null) "secret_file:${cfg.secretFile}"); requiresRuntimeSystemdCredentials = (lib.length runtimeSystemdCredentials) != 0; @@ -195,7 +196,6 @@ let overrideConfig = let c = cfg.config; - requiresReadSecretFunction = c.dbpassFile != null || c.objectstore.s3.enable; objectstoreConfig = let s3 = c.objectstore.s3; @@ -232,7 +232,7 @@ let in pkgs.writeText "nextcloud-config.php" ''