doc: lib.types.attrsWith init documentation (#361358)

This commit is contained in:
Silvan Mosberger 2024-12-04 20:52:00 +01:00 committed by GitHub
commit 4bdc7d1d45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -399,6 +399,23 @@ Composed types are types that take a type as parameter. `listOf
returned instead for the same `mkIf false` definition.
:::
`types.attrsWith` { *`elemType`*, *`lazy`* ? false }
: An attribute set of where all the values are of *`elemType`* type.
**Parameters**
`elemType` (Required)
: Specifies the type of the values contained in the attribute set.
`lazy`
: Determines whether the attribute set is lazily evaluated. See: `types.lazyAttrsOf`
**Behavior**
- `attrsWith { elemType = t; }` is equivalent to `attrsOf t`
- `attrsWith { lazy = true; elemType = t; }` is equivalent to `lazyAttrsOf t`
`types.uniq` *`t`*
: Ensures that type *`t`* cannot be merged. It is used to ensure option