anchor.diff:  
               $EXTRACONFIG = json_decode(file_get_contents("${jsonFormat.generate "nextcloud-extraOptions.json" cfg.extraOptions}"), true);
   
  -            $CONFIG = array_merge($CONFIG, $EXTRACONFIG);
  +            if (json_last_error() !== JSON_ERROR_NONE) {
  +              throw new \RuntimeException(sprintf("Cannot decode %s, because: %s", $filename, json_last_error_msg()));
  +            }
  +
  +            $CONFIG = array_replace_recursive($CONFIG, $EXTRACONFIG);
               ${optionalString (cfg.secretFile != null) ''
                 $CONFIG = array_merge($CONFIG, nix_read_file(
                   ${cfg.secretFile}),
  
positive.code:           password = "secret";
            timeout = 1.5;
          };
        };
      };
  
      secretFile = mkOption {
  
negative.code:       description = ''
          Extra options which should be appended to nextcloud's config.php file.
        '';
        example = literalExample '' {
          redis = {
            host = "/run/redis/redis.sock";
            port = 0;
  