From 1ad30772ea4feca0b597446e102fb323c89c41a0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 28 Jan 2024 16:24:59 +0100 Subject: [PATCH] doc/option-types: Move attrTag to Sum types, remove redundant paragraph --- .../doc/manual/development/option-types.section.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index 8dde0aba4b2b..f8b25d90088d 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -307,7 +307,11 @@ Nix does not have a built-in syntax for this pairing of a label and a type or va If the built-in Nix value types provide enough distinction, you simplify your syntax with a [union type](#sec-option-types-unions) instead. +`types.attrTag` *`{ attr1 = t1; attr2 = t2; ... }`* +: An attribute set containing one attribute, whose name must be picked from + the attribute set (`attr1`, etc) and whose value must be of the accompanying + type. ## Composed types {#sec-option-types-composed} @@ -365,16 +369,6 @@ Composed types are types that take a type as parameter. `listOf the line `The option