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 3636 removeWhitespace = builtins . replaceStrings [ " " ] [ "" ] ;
3737
3838 getSubOptions =
39- opts : path : lib . optionalAttrs ( isVisible opts ) ( removeUnwanted ( opts . type . getSubOptions path ) ) ;
39+ opts : path :
40+ lib . optionalAttrs ( isDeeplyVisible opts ) ( removeUnwanted ( opts . type . getSubOptions path ) ) ;
4041
41- isVisible =
42- opts :
42+ isVisible = isVisibleWith true ;
43+ isDeeplyVisible = isVisibleWith false ;
44+
45+ isVisibleWith =
46+ shallow : opts :
47+ let
48+ test =
49+ opt :
50+ let
51+ internal = opt . internal or false ;
52+ visible = opt . visible or true ;
53+ visible' = if visible == "shallow" then shallow else visible ;
54+ in
55+ visible' && ! internal ;
56+ in
4357 if lib . isOption opts then
44- opts . visible or true && ! ( opts . internal or false )
58+ test opts
4559 else if opts . isOption then
46- opts . index . options . visible or true && ! ( opts . index . options . internal or false )
60+ test opts . index . options
4761 else
4862 let
49- filterFunc = lib . filterAttrs ( _ : v : if lib . isAttrs v then isVisible v else true ) ;
50-
63+ filterFunc = lib . filterAttrs ( _ : v : if lib . isAttrs v then isVisibleWith shallow v else true ) ;
5164 hasEmptyIndex = ( filterFunc opts . index . options ) == { } ;
5265 hasEmptyComponents = ( filterFunc opts . components ) == { } ;
5366 in
You can’t perform that action at this time.
0 commit comments