How to set user-agent for fetchurl?

I need to pass a proper user-agent with witespace (let’s say “FOO 1.0”) to fetchurl, so I’ve added:
curlOpts = "--user-agent 'FOO 1.0'";
But in such case curlOpts evaluated into “–user-agent FOO 1.0” (without single quotes) in the fetchurl builder.sh. I’ve tried to escape quotes in a different ways with no success.
How is it possible to get it escaped properly? Or some modification of fetchurl builder is required?

https://github.com/NixOS/nixpkgs/issues/90034