From 727bdd736c3977e17ba3c3051280fe9aa21914da Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 31 Mar 2021 14:52:45 +0200 Subject: [PATCH] nixos/nextcloud: use array_merge instead of array_push This should correctly merge the various configs (via nix module options, the secretFile option, and the extraOptions option). --- nixos/modules/services/web-apps/nextcloud.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 0777c4f671d0..e91ea833e097 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -520,10 +520,10 @@ in { ${optionalString (c.defaultPhoneRegion != null) "'default_phone_region' => '${c.defaultPhoneRegion}',"} ]; - $EXTRACONFIG = json_decode('${builtins.toJSON cfg.extraOptions}', true); + $EXTRACONFIG = json_decode(file_get_contents("${jsonFormat.generate "nextcloud-extraOptions.json" cfg.extraOptions}"), true); - array_push($CONFIG, $EXTRACONFIG); - ${optionalString (cfg.secretFile != null) "array_push($CONFIG, nix_read_secrets());"} + $CONFIG = array_merge($CONFIG, $EXTRACONFIG); + ${optionalString (cfg.secretFile != null) "$CONFIG = array_merge($CONFIG, nix_read_secrets());"} ''; occInstallCmd = let dbpass = if c.dbpassFile != null