From a0ddb8af40bee08737170b167e04ab608215d8de Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 6 May 2023 16:23:08 +0200 Subject: [PATCH] docs: Mention GVariant auto-coercion at the top --- docs/writing-modules.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing-modules.adoc b/docs/writing-modules.adoc index b502c17c8..482bc7702 100644 --- a/docs/writing-modules.adoc +++ b/docs/writing-modules.adoc @@ -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,