diff --git a/README.md b/README.md index d194cfe..004443e 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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) ]; }