From b3c9916455799123301a534ba604880e7cc1d7e5 Mon Sep 17 00:00:00 2001 From: sodiboo Date: Sun, 22 Jun 2025 21:23:18 +0200 Subject: [PATCH] lib.types.attrTag: expose suboptions at correct level --- lib/tests/modules/types-attrTag.nix | 2 +- lib/types.nix | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/tests/modules/types-attrTag.nix b/lib/tests/modules/types-attrTag.nix index 82d6e3c17590..f30c1fc904f8 100644 --- a/lib/tests/modules/types-attrTag.nix +++ b/lib/tests/modules/types-attrTag.nix @@ -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."; + mergedSubOption = (options.merged.type.getSubOptions options.merged.loc).extensible; in { options = { diff --git a/lib/types.nix b/lib/types.nix index 591bcaf7dc9d..9c409f7e254c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -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: