Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ This example shows how to load all nix files inside `./modules`, following the
}
```

## Quick Usage (outside a modules evaluation)

If you want to get a list of nix files programmatically outside of a modules evaluation,
you can use the import-tree API (read below for more).

```nix
(import-tree.withLib pkgs.lib).leafs ./modules # => list of .nix files
```

## Ignored files

Paths that have a component that begins with an underscore are ignored.
Expand All @@ -30,6 +39,7 @@ Paths that have a component that begins with an underscore are ignored.
The following goes recursively through `./modules` and imports all `.nix` files.

```nix
# Usage as part of any nix module system.
{config, ...} {
imports = [ (import-tree ./modules) ];
}
Expand Down