#flake-explorer documentation
flake-explorer is an interactive visualizer for Nix flakes — optimized for dendritic
(flake-parts + import-tree)
configurations, but it works on any flake. It evaluates a flake with your own
nix binary, extracts its outputs, module hierarchy, option values, and file
provenance into JSON, and renders them in a three-pane Svelte 5 SPA that can be
served locally or exported as a single standalone HTML file
(see the top-level README for quick-start usage).

The three panes:
- Left — outputs & modules. Every flake output; expanding a configuration reveals its module hierarchy in the flake's own directory (mounting) structure, plus per-input subtrees, with badges counting customized options.
- Center — detail. A selected module's Configures (values it sets, with
mkForce/mkDefaultpriority chips) and Declares (options it defines), plus fullflake.lockprovenance for input modules. - Right — files. Every
.nixfile the flake references, grouped by origin (self first, then inputs), with per-file git info and import relationships.
#System at a glance
One CLI entry point (flake-explorer.ts) dispatches
extract, export, and serve. All three run the same extraction driver,
which shells out to the host nix binary to evaluate
src/extract/extract.nix and writes a data
directory: a cheap manifest.json plus one expensive per-configuration blob.
serve builds the SPA in-memory and extracts configurations on demand;
export embeds the SPA and data into one HTML file
(src/export.ts).
flowchart LR cli["CLI: extract / export / serve"] --> ext["extractor: nix eval extract.nix"] ext --> data["data dir: manifest.json + per-config JSON"] data --> serve["serve: HTTP server"] data --> export["export: single HTML file"] serve --> spa["Svelte SPA in browser"] export --> spa
#Pages
| Page | What it answers |
|---|---|
| Architecture | How the pieces fit together; key design decisions and the directory map. |
| Data schema | The manifest / config-blob contract in src/schema.ts. |
| Extraction pipeline | How extract.nix, the chunk walk, and the narHash cache work. |
| Frontend | The Svelte 5 SPA: state, indexes, components, theming. |
| Build & infra | Bun bundling, Nix packaging, CI, and Pages publishing. |
| CLI reference | Every command and flag of the flake-explorer CLI. |
| Testing | The bun test suite, fixtures, and how to run it. |
| Glossary | Project-specific terms, each linked to its source. |
#Links
- Live demo: https://kris.net/flake-explorer/ — the tool exploring its own flake.
- API reference: https://kris.net/flake-explorer/docs/api/ — generated in CI
from
src/schema.tsvia typedoc; only on the site. - Repository: https://github.com/kriswill/flake-explorer
- CHANGELOG