lib.types.attrTag: expose suboptions at correct level
This commit is contained in:
parent
9f7c0e8a7e
commit
b3c9916455
@ -7,7 +7,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
forceDeep = x: builtins.deepSeq x x;
|
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
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -919,12 +919,7 @@ let
|
|||||||
description = "attribute-tagged union";
|
description = "attribute-tagged union";
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
getSubOptions =
|
getSubOptions =
|
||||||
prefix:
|
prefix: mapAttrs (tagName: tagOption: tagOption // { loc = prefix ++ [ tagName ]; }) tags;
|
||||||
mapAttrs (tagName: tagOption: {
|
|
||||||
"${lib.showOption prefix}" = tagOption // {
|
|
||||||
loc = prefix ++ [ tagName ];
|
|
||||||
};
|
|
||||||
}) tags;
|
|
||||||
check = v: isAttrs v && length (attrNames v) == 1 && tags ? ${head (attrNames v)};
|
check = v: isAttrs v && length (attrNames v) == 1 && tags ? ${head (attrNames v)};
|
||||||
merge =
|
merge =
|
||||||
loc: defs:
|
loc: defs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user