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 35
35
removeWhitespace = builtins . replaceStrings [ " " ] [ "" ] ;
36
36
37
37
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 ) ) ;
39
40
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
42
56
if lib . isOption opts then
43
- opts . visible or true && ! ( opts . internal or false )
57
+ test opts
44
58
else if opts . isOption then
45
- opts . index . options . visible or true && ! ( opts . index . options . internal or false )
59
+ test opts . index . options
46
60
else
47
61
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 ) ;
50
63
hasEmptyIndex = ( filterFunc opts . index . options ) == { } ;
51
64
hasEmptyComponents = ( filterFunc opts . components ) == { } ;
52
65
in
You can’t perform that action at this time.
0 commit comments