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).
This commit is contained in:
stuebinm 2021-03-31 14:52:45 +02:00
parent fb389cb0db
commit 727bdd736c
No known key found for this signature in database
GPG key ID: 8FBE8AAD32FA12B7

View file

@ -520,10 +520,10 @@ in {
${optionalString (c.defaultPhoneRegion != null) "'default_phone_region' => '${c.defaultPhoneRegion}',"} ${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); $CONFIG = array_merge($CONFIG, $EXTRACONFIG);
${optionalString (cfg.secretFile != null) "array_push($CONFIG, nix_read_secrets());"} ${optionalString (cfg.secretFile != null) "$CONFIG = array_merge($CONFIG, nix_read_secrets());"}
''; '';
occInstallCmd = let occInstallCmd = let
dbpass = if c.dbpassFile != null dbpass = if c.dbpassFile != null