types.attrListWith: init

Trivial extraction from attrListOf.
This commit is contained in:
Robert Hensing
2026-04-19 13:00:03 +01:00
committed by Johannes Kirschbauer
parent 43d998e6c0
commit 17fdb6f68a
2 changed files with 17 additions and 2 deletions

View File

@@ -810,8 +810,10 @@ rec {
substSubModules = m: nonEmptyListOf (elemType.substSubModules m);
};
attrListOf =
elemType:
attrListOf = elemType: attrListWith { inherit elemType; };
attrListWith =
{ elemType }:
mkOptionType rec {
name = "attrListOf";
description = "attribute list of ${

View File

@@ -512,6 +512,19 @@ Composed types are types that take a type as parameter. `listOf
Multiple definitions of the same option are concatenated and then sorted by priority.
Entries at the same priority level preserve their definition order.
`types.attrListWith` { *`elemType`* }
: An ordered list of single-attribute attribute sets, where each value is of *`elemType`* type.
**Parameters**
`elemType` (Required)
: Specifies the type of each value in the attribute list.
**Behavior**
- `attrListWith { elemType = t; }` is equivalent to `attrListOf t`
`types.uniq` *`t`*
: Ensures that type *`t`* cannot be merged. It is used to ensure option