docs: Mention GVariant auto-coercion at the top

This commit is contained in:
Jan Tojnar 2023-05-06 16:23:08 +02:00 committed by Robert Helgesson
parent cfa5c2869b
commit a0ddb8af40
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -80,7 +80,7 @@ would place `c` before `b` and after `a` in the graph.
[[sec-option-types-gvariant]]`hm.types.gvariant`::
This type is useful for options representing {gvariant-description}[GVariant] values. The type accepts all primitive GVariant types as well as arrays, tuples, ``maybe'' types, and dictionaries.
+
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
Some Nix values are automatically coerced to matching GVariant value but the GVariant model is richer so you may need to use one of the provided constructor functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
+
[[sec-option-types-gvariant-mkBoolean]]`hm.gvariant.mkBoolean (v: bool)`:::
Takes a Nix value `v` to a GVariant `boolean` value. Note, Nix booleans are automatically coerced using this function. That is,