diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index fef72c5b1392..beb628c42214 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -293,9 +293,6 @@ let ) "'dbtableprefix' => '${toString c.dbtableprefix}',"} ${lib.optionalString (c.dbpassFile != null) "'dbpassword' => nix_read_secret('dbpass'),"} 'dbtype' => '${c.dbtype}', - ${lib.concatStringsSep "\n" ( - lib.mapAttrsToList (name: credential: "'${name}' => nix_read_secret('${name}'),") cfg.secrets - )} ${objectstoreConfig} ]; @@ -304,6 +301,12 @@ let "impossible: this should never happen (decoding generated settings file %s failed)" )); + $CONFIG = array_replace_recursive($CONFIG, [ + ${lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: credential: "'${name}' => nix_read_secret('${name}'),") cfg.secrets + )} + ]); + ${lib.optionalString (cfg.secretFile != null) '' $CONFIG = array_replace_recursive($CONFIG, nix_read_secret_and_decode_json_file('secret_file')); ''}