mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
docs: Add inline anchors for direct linking to GVariant types
This commit is contained in:
parent
c752906800
commit
3e906060a8
1 changed files with 19 additions and 19 deletions
|
@ -77,12 +77,12 @@ foo.bar = {
|
||||||
+
|
+
|
||||||
would place `c` before `b` and after `a` in the graph.
|
would place `c` before `b` and after `a` in the graph.
|
||||||
|
|
||||||
`hm.types.gvariant`::
|
[[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 and tuples. Dictionaries are not currently supported.
|
This type is useful for options representing {gvariant-description}[GVariant] values. The type accepts all primitive GVariant types as well as arrays and tuples. Dictionaries are not currently supported.
|
||||||
+
|
+
|
||||||
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
|
To create a GVariant value you can use a number of provided functions. Examples assume an option `foo.bar` of type `hm.types.gvariant`.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkBoolean (v: bool)`:::
|
[[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,
|
Takes a Nix value `v` to a GVariant `boolean` value. Note, Nix booleans are automatically coerced using this function. That is,
|
||||||
+
|
+
|
||||||
[source,nix]
|
[source,nix]
|
||||||
|
@ -96,7 +96,7 @@ is equivalent to
|
||||||
----
|
----
|
||||||
foo.bar = true;
|
foo.bar = true;
|
||||||
----
|
----
|
||||||
`hm.gvariant.mkString (v: string)`:::
|
[[sec-option-types-gvariant-mkString]]`hm.gvariant.mkString (v: string)`:::
|
||||||
Takes a Nix value `v` to a GVariant `string` value. Note, Nix strings are automatically coerced using this function. That is,
|
Takes a Nix value `v` to a GVariant `string` value. Note, Nix strings are automatically coerced using this function. That is,
|
||||||
+
|
+
|
||||||
[source,nix]
|
[source,nix]
|
||||||
|
@ -110,15 +110,15 @@ is equivalent to
|
||||||
----
|
----
|
||||||
foo.bar = "a string";
|
foo.bar = "a string";
|
||||||
----
|
----
|
||||||
`hm.gvariant.mkObjectpath (v: string)`:::
|
[[sec-option-types-gvariant-mkObjectpath]]`hm.gvariant.mkObjectpath (v: string)`:::
|
||||||
Takes a Nix value `v` to a GVariant `objectpath` value.
|
Takes a Nix value `v` to a GVariant `objectpath` value.
|
||||||
`hm.gvariant.mkUchar (v: string)`:::
|
[[sec-option-types-gvariant-mkUchar]]`hm.gvariant.mkUchar (v: string)`:::
|
||||||
Takes a Nix value `v` to a GVariant `uchar` value.
|
Takes a Nix value `v` to a GVariant `uchar` value.
|
||||||
`hm.gvariant.mkInt16 (v: int)`:::
|
[[sec-option-types-gvariant-mkInt16]]`hm.gvariant.mkInt16 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `int16` value.
|
Takes a Nix value `v` to a GVariant `int16` value.
|
||||||
`hm.gvariant.mkUint16 (v: int)`:::
|
[[sec-option-types-gvariant-mkUint16]]`hm.gvariant.mkUint16 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `uint16` value.
|
Takes a Nix value `v` to a GVariant `uint16` value.
|
||||||
`hm.gvariant.mkInt32 (v: int)`:::
|
[[sec-option-types-gvariant-mkInt32]]`hm.gvariant.mkInt32 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `int32` value. Note, Nix integers are automatically coerced using this function. That is,
|
Takes a Nix value `v` to a GVariant `int32` value. Note, Nix integers are automatically coerced using this function. That is,
|
||||||
+
|
+
|
||||||
[source,nix]
|
[source,nix]
|
||||||
|
@ -132,13 +132,13 @@ is equivalent to
|
||||||
----
|
----
|
||||||
foo.bar = 7;
|
foo.bar = 7;
|
||||||
----
|
----
|
||||||
`hm.gvariant.mkUint32 (v: int)`:::
|
[[sec-option-types-gvariant-mkUint32]]`hm.gvariant.mkUint32 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `uint32` value.
|
Takes a Nix value `v` to a GVariant `uint32` value.
|
||||||
`hm.gvariant.mkInt64 (v: int)`:::
|
[[sec-option-types-gvariant-mkInt64]]`hm.gvariant.mkInt64 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `int64` value.
|
Takes a Nix value `v` to a GVariant `int64` value.
|
||||||
`hm.gvariant.mkUint64 (v: int)`:::
|
[[sec-option-types-gvariant-mkUint64]]`hm.gvariant.mkUint64 (v: int)`:::
|
||||||
Takes a Nix value `v` to a GVariant `uint64` value.
|
Takes a Nix value `v` to a GVariant `uint64` value.
|
||||||
`hm.gvariant.mkDouble (v: double)`:::
|
[[sec-option-types-gvariant-mkDouble]]`hm.gvariant.mkDouble (v: double)`:::
|
||||||
Takes a Nix value `v` to a GVariant `double` value. Note, Nix floats are automatically coerced using this function. That is,
|
Takes a Nix value `v` to a GVariant `double` value. Note, Nix floats are automatically coerced using this function. That is,
|
||||||
+
|
+
|
||||||
[source,nix]
|
[source,nix]
|
||||||
|
@ -153,7 +153,7 @@ is equivalent to
|
||||||
foo.bar = 3.14;
|
foo.bar = 3.14;
|
||||||
----
|
----
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkArray type elements`:::
|
[[sec-option-types-gvariant-mkArray]]`hm.gvariant.mkArray type elements`:::
|
||||||
Builds a GVariant array containing the given list of elements, where each element is a GVariant value of the given type. The `type` value can be constructed using
|
Builds a GVariant array containing the given list of elements, where each element is a GVariant value of the given type. The `type` value can be constructed using
|
||||||
+
|
+
|
||||||
--
|
--
|
||||||
|
@ -176,20 +176,20 @@ Builds a GVariant array containing the given list of elements, where each elemen
|
||||||
+
|
+
|
||||||
where `type` and `types` are themselves a type and list of types, respectively.
|
where `type` and `types` are themselves a type and list of types, respectively.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkEmptyArray type`:::
|
[[sec-option-types-gvariant-mkEmptyArray]]`hm.gvariant.mkEmptyArray type`:::
|
||||||
An alias of `hm.gvariant.mkArray type []`.
|
An alias of `hm.gvariant.mkArray type []`.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkNothing type`:::
|
[[sec-option-types-gvariant-mkNothing]]`hm.gvariant.mkNothing type`:::
|
||||||
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
|
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkJust element`:::
|
[[sec-option-types-gvariant-mkJust]]`hm.gvariant.mkJust element`:::
|
||||||
Builds a GVariant maybe value containing the given GVariant element.
|
Builds a GVariant maybe value containing the given GVariant element.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkTuple elements`:::
|
[[sec-option-types-gvariant-mkTuple]]`hm.gvariant.mkTuple elements`:::
|
||||||
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.
|
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkVariant element`:::
|
[[sec-option-types-gvariant-mkVariant]]`hm.gvariant.mkVariant element`:::
|
||||||
Builds a GVariant variant which contains the value of a GVariant element.
|
Builds a GVariant variant which contains the value of a GVariant element.
|
||||||
+
|
+
|
||||||
`hm.gvariant.mkDictionaryEntry elements`:::
|
[[sec-option-types-gvariant-mkDictionaryEntry]]`hm.gvariant.mkDictionaryEntry elements`:::
|
||||||
Builds a GVariant dictionary entry containing the given list of elements, where each element is a GVariant value.
|
Builds a GVariant dictionary entry containing the given list of elements, where each element is a GVariant value.
|
||||||
|
|
Loading…
Reference in a new issue