From f2d4dc7a32bff560afe0e02660d1ae110751700c Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 3 Dec 2024 08:37:33 +0100 Subject: [PATCH] doc: lib.types.attrsWith init documentation --- .../manual/development/option-types.section.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index b44a84553b37..a9c8f2f8a88d 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -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