···66666767For more advanced usage, `import-tree` can be configured via its extensible API.
68686969-______________________________________________________________________
6969+---
70707171#### Obtaining the API
7272···228228229229##### 🌳 `import-tree.initFilter`
230230231231-*Replaces* the initial filter which defaults to: Include files with `.nix` suffix and not having `/_` infix.
231231+_Replaces_ the initial filter which defaults to: Include files with `.nix` suffix and not having `/_` infix.
232232233233```nix
234234import-tree.initFilter (p: lib.hasSuffix ".nix" p && !lib.hasInfix "/ignored/" p)
···257257(import-tree.addPath ./modules) [ ]
258258```
259259260260-______________________________________________________________________
260260+---
261261262262## Why
263263···280280281281@vic is using this on [Dendrix](https://github.com/vic/dendrix) for [community conventions](https://github.com/vic/dendrix/blob/main/dev/modules/community/_pipeline.nix) on tagging files.
282282283283-This would allow us to have community-driven *sets* of configurations,
283283+This would allow us to have community-driven _sets_ of configurations,
284284much like those popular for editors: spacemacs/lazy-vim distributions.
285285286286Imagine an editor distribution exposing the following flake output:
···288288```nix
289289# editor-distro's flakeModule
290290{inputs, lib, ...}:
291291-let
291291+let
292292 flake.lib.modules-tree = lib.pipe inputs.import-tree [
293293 (i: i.addPath ./modules)
294294 (i: i.addAPI { inherit on off exclusive; })
···323323}
324324```
325325326326-______________________________________________________________________
326326+---
327327328328## Testing
329329···332332The test suite can be found in [`checkmate.nix`](checkmate.nix). To run it locally:
333333334334```sh
335335-nix flake check path:checkmate --override-input target path:.
335335+nix flake check github:vic/checkmate --override-input target path:.
336336```
337337338338Run the following to format files: