943e2d67

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Carry a codec's comments into the option it generates

A comment written with <?> or <??> was thrown away when a field became a Nix
option, so only the field's own description survived.  That is the wrong half
to keep for a shared type: a field says what it is for where the field is, and
a type says what it means where the type is, and whoever reads the NixOS module
generated from the codec wants both.  Documentation written on a codec reached
the rendered configuration documentation and silently never reached the module.

Both now, the field's description first and then the comments from outermost
in, joined by newlines.  Through a BimapCodec as the option type already is,
because a codec written for one type in terms of another is still that type's
codec.  Through the EitherCodec that maybeCodec is, recognised by one of its
sides being the null codec, because optionalFieldOrNullWith builds its field
that way and a codec made nullable is still that codec.  Not into any other
EitherCodec or into an ArrayOfCodec, whose comments are about something the
option is made of rather than about the option.

A field with a comment and no description of its own now has a description,
where before it had none at all.
forwardCompatibilitynixpkgs-25_05nixpkgs-25_11pre-commitreleaseconfiguredeploy:release-to-hackagedevShellautodocodecautodocodec-api-usageautodocodec-exactautodocodec-http-api-dataautodocodec-nixautodocodec-openapi3autodocodec-schemaautodocodec-servant-multipartautodocodec-swagger2autodocodec-yamlrelease-to-hackagex86_64-linux