Help to wrap correctly electron parameters

Hi,

I am trying to wrap additional parameters for ferdium here
https://github.com/NixOS/nixpkgs/commit/079f664ed10d323aeee60e10f3bd5f0806bae53d

Even if the parameters appears as in the nix file on the call to the wrapped binary it does not seems to be passed in the end. I took elements from this topic Partly overriding a .desktop entry but I think something may be wrong as it is not the makeWrapper function that is used.

What am I missing here?

I tried to find a solution to this and it seems the evaluation of
${NIXOS_OZONE_WL:+${WAYLAND_DISPLAY:+--ozone-platform=wayland}} ${NIXOS_OZONE_WL:+${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer}}
is not working even if the variables are set in my env. The resulted spawned binary does not have the arguments set.

if I change the lines in the wrapProgram function into

--add-flags --ozone-platform=wayland \
--add-flags --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer

it works I can see the args in the spawned binary. Any idea ?