mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 10:22:54 +08:00
lib.types.attrTag: expose suboptions at correct level
(cherry picked from commit b3c9916455)
This commit is contained in:
committed by
github-actions[bot]
parent
368f9b6bf7
commit
7c871446f4
@@ -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 = {
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user