diff options
author | Robert Hensing <robert@roberthensing.nl> | 2024-01-29 07:10:14 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2024-04-04 11:54:41 +0200 |
commit | 5b49672af44875df0449f7ff1b55965eedeec1da (patch) | |
tree | 95bc925c9eb0f64dec8734242dfb46811d8f99c0 /lib/types.nix | |
parent | 6949bc21ce1de068bc1b21e273d15620c0e5770e (diff) |
lib.types.attrTag: Support module docs
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index 59577856f4e1f..5286ce76862e2 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -623,7 +623,11 @@ rec { mkOptionType { name = "attrTag"; description = "attribute-tagged union of ${choicesStr}"; - getSubModules = null; + getSubOptions = prefix: + mapAttrs + (tagName: tagType: + tagType.getSubOptions (prefix ++ [ tagName ])) + tags; substSubModules = m: attrTagWith { tags = mapAttrs (n: v: v.substSubModules m) tags; }; check = v: isAttrs v && length (attrNames v) == 1 && tags?${head (attrNames v)}; merge = loc: defs: |