vic/import-tree
{ "defaultBranch": "main", "description": "Import all nix files in a directory tree.", "fullName": "vic/import-tree", "homepage": "http://import-tree.oeiuwq.com/", "language": "Nix", "name": "import-tree", "pushedAt": "2026-03-16T20:40:35Z", "stargazersCount": 203, "updatedAt": "2026-03-21T19:57:45Z", "url": "https://github.com/vic/import-tree"}
import-treeand vic’s dendritic libs made for you with Love++ and AI—. If you like my work, consider sponsoring
🌲🌴 import-tree 🎄🌳
Section titled “🌲🌴 import-tree 🎄🌳”Recursively import Nix modules from a directory, with a simple, extensible API.
Features
Section titled “Features”🌳 Works with NixOS, nix-darwin, home-manager, flake-parts, NixVim, etc.
🌲 Callable as a deps-free Flake or nix lib.
🌴 Sensible defaults and configurable behaviour.
🌵 Chain .filter, .match, .map for precise file selection.
🎄 Extensible: .addAPI to create domain-specific instances.
🌿 Built to enable the Dendritic Pattern on both stable/unstable Nix.
🌱 Growing community adoption
Quick Start
Section titled “Quick Start”The following examples show how to import all module files.
By default, paths having /_ are ignored. See API documentation for advanced usage.
Related projects: vic/flake-file, vic/with-inputs
Dendritic flake-parts
Section titled “Dendritic flake-parts”{ inputs.import-tree.url = "github:vic/import-tree"; inputs.flake-parts.url = "github:hercules-ci/flake-parts";
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);}Dendritic flake without flake-parts
Section titled “Dendritic flake without flake-parts”{ inputs.import-tree.url = "github:vic/import-tree"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
outputs = inputs: (inputs.nixpkgs.lib.evalModules { specialArgs.inputs = inputs; modules = [ (inputs.import-tree ./modules) ]; }).config;}Dendritic Nix (non-flakes, stable Nix)
Section titled “Dendritic Nix (non-flakes, stable Nix)”This example uses with-inputs to provide flake-file inputs from npins sources.
let sources = import ./npins; with-inputs = import sources.with-inputs sources {}; outputs = inputs: (inputs.nixpkgs.lib.evalModules { specialArgs.inputs = inputs; modules = [ (inputs.import-tree ./modules) ]; }).config;inwith-inputs outputsDocumentation
Section titled “Documentation”📖 Full documentation — guides, API reference, and examples.
Testing
Section titled “Testing”import-tree uses checkmate for testing:
nix flake check github:vic/checkmate --override-input target path:.