File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 194
194
expected = "world" ;
195
195
} ;
196
196
197
+ import-tree . "test take as arg anything path convertible" = {
198
+ expr = lit . leafs [
199
+ {
200
+ outPath = ./tree/modules/hello-world ;
201
+ }
202
+ ] ;
203
+ expected = [ ./tree/modules/hello-world/mod.nix ] ;
204
+ } ;
205
+
197
206
import-tree . "test can take other import-trees as if they were paths" = {
198
207
expr = ( lit . filter ( lib . hasInfix "mod" ) ) . leafs [
199
208
( it . addPath ./tree/modules/hello-option )
Original file line number Diff line number Diff line change 33
33
x :
34
34
if isImportTree x then
35
35
treeFiles x
36
+ else if hasOutPath x then
37
+ listFilesRecursive x . outPath
36
38
else if lib . pathIsDirectory x then
37
39
lib . filesystem . listFilesRecursive x
38
40
else
69
71
attrs : k : f :
70
72
attrs // { ${ k } = f attrs . ${ k } ; } ;
71
73
74
+ hasOutPath = and ( x : x ? outPath ) builtins . isAttrs ;
75
+
72
76
isImportTree = and ( x : x ? __config . __functor ) builtins . isAttrs ;
73
77
74
78
inModuleEval = and ( x : x ? options ) builtins . isAttrs ;
You can’t perform that action at this time.
0 commit comments