File tree 1 file changed +20
-7
lines changed
1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 36
36
removeWhitespace = builtins . replaceStrings [ " " ] [ "" ] ;
37
37
38
38
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 ) ) ;
40
41
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
43
57
if lib . isOption opts then
44
- opts . visible or true && ! ( opts . internal or false )
58
+ test opts
45
59
else if opts . isOption then
46
- opts . index . options . visible or true && ! ( opts . index . options . internal or false )
60
+ test opts . index . options
47
61
else
48
62
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 ) ;
51
64
hasEmptyIndex = ( filterFunc opts . index . options ) == { } ;
52
65
hasEmptyComponents = ( filterFunc opts . components ) == { } ;
53
66
in
You can’t perform that action at this time.
0 commit comments