Apparently this is a known issue for which a fix will be released soon. So I remove my local fix, for which, by the way, I have found the correct syntax (this was my question) :
You need to add a <your-project>.opam.template file, then when dune generates the <your-project.opam file it will append the values of the template to it.