File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 3535 removeWhitespace = builtins . replaceStrings [ " " ] [ "" ] ;
3636
3737 getSubOptions =
38- opts : path : lib . optionalAttrs ( isVisible opts ) ( removeUnwanted ( opts . type . getSubOptions path ) ) ;
38+ opts : path :
39+ lib . optionalAttrs ( isDeeplyVisible opts ) ( removeUnwanted ( opts . type . getSubOptions path ) ) ;
3940
40- isVisible =
41- opts :
41+ isVisible = isVisibleWith true ;
42+ isDeeplyVisible = isVisibleWith false ;
43+
44+ isVisibleWith =
45+ shallow : opts :
46+ let
47+ test =
48+ opt :
49+ let
50+ internal = opt . internal or false ;
51+ visible = opt . visible or true ;
52+ visible' = if visible == "shallow" then shallow else visible ;
53+ in
54+ visible' && ! internal ;
55+ in
4256 if lib . isOption opts then
43- opts . visible or true && ! ( opts . internal or false )
57+ test opts
4458 else if opts . isOption then
45- opts . index . options . visible or true && ! ( opts . index . options . internal or false )
59+ test opts . index . options
4660 else
4761 let
48- filterFunc = lib . filterAttrs ( _ : v : if lib . isAttrs v then isVisible v else true ) ;
49-
62+ filterFunc = lib . filterAttrs ( _ : v : if lib . isAttrs v then isVisibleWith shallow v else true ) ;
5063 hasEmptyIndex = ( filterFunc opts . index . options ) == { } ;
5164 hasEmptyComponents = ( filterFunc opts . components ) == { } ;
5265 in
You can’t perform that action at this time.
0 commit comments