lib.types.attrTag: expose suboptions at correct level (#419081)

This commit is contained in:
Robert Hensing
2025-06-23 08:42:09 +02:00
committed by GitHub
2 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
let
inherit (lib) mkOption types;
forceDeep = x: builtins.deepSeq x x;
mergedSubOption = (options.merged.type.getSubOptions options.merged.loc).extensible."merged.<name>";
mergedSubOption = (options.merged.type.getSubOptions options.merged.loc).extensible;
in
{
options = {
+1 -6
View File
@@ -919,12 +919,7 @@ let
description = "attribute-tagged union";
descriptionClass = "noun";
getSubOptions =
prefix:
mapAttrs (tagName: tagOption: {
"${lib.showOption prefix}" = tagOption // {
loc = prefix ++ [ tagName ];
};
}) tags;
prefix: mapAttrs (tagName: tagOption: tagOption // { loc = prefix ++ [ tagName ]; }) tags;
check = v: isAttrs v && length (attrNames v) == 1 && tags ? ${head (attrNames v)};
merge =
loc: defs: