Skip to content

Commit e6603e9

Browse files
committed
Use toString on attrs having outPath
1 parent e5a363c commit e6603e9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

checkmate.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ in
194194
expected = "world";
195195
};
196196

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+
197206
import-tree."test can take other import-trees as if they were paths" = {
198207
expr = (lit.filter (lib.hasInfix "mod")).leafs [
199208
(it.addPath ./tree/modules/hello-option)

default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ let
3333
x:
3434
if isImportTree x then
3535
treeFiles x
36+
else if hasOutPath x then
37+
listFilesRecursive x.outPath
3638
else if lib.pathIsDirectory x then
3739
lib.filesystem.listFilesRecursive x
3840
else
@@ -69,6 +71,8 @@ let
6971
attrs: k: f:
7072
attrs // { ${k} = f attrs.${k}; };
7173

74+
hasOutPath = and (x: x ? outPath) builtins.isAttrs;
75+
7276
isImportTree = and (x: x ? __config.__functor) builtins.isAttrs;
7377

7478
inModuleEval = and (x: x ? options) builtins.isAttrs;

0 commit comments

Comments
 (0)