Sharing a flake I’ve been working on: it produces a generic terminal dashboard (Haskell/Brick) whose panels are authored as .nix files. The renderer is fixed; the meaning — URLs, JSON paths, sections, thresholds — lives in the nix.
Nix-side interesting bits:
lib/loadDomains.nix is a small readDir helper that walks ./domains/ and imports every .nix file, so adding a domain is “drop a file” with no registration elsewhere.
lib/sections.nix exposes section constructors (headline, caption, stat, sparkline, table, articles, legend, groupCount) so authors write with lib.sections; [ (headline "…") (stat { … }) ] instead of { type = "stat"; … } by hand.
lib/mkDomain.nix validates at eval time — missing required keys and unknown attrs both throw with a path-aware error: mkDomain: domain 'my-api' → source [0] (https://…) → panel [1] 'Overview' → section [2] (stat) is missing required key(s): label. Authoring a broken domain fails the build instead of silently rendering nothing.
The flake evaluates every domain to one JSON blob via pkgs.writeText "terminal-top-domains.json" (builtins.toJSON (import ./lib/loadDomains.nix ./domains)), and the wrapper bakes TERMINAL_TOP_DOMAINS_JSON=${domains-json} onto the binary. Pure eval (no --impure, no builtins.getEnv); zero Nix dependency at runtime.
Env-var interpolation (${VAR} / ${VAR:-default}) inside URLs and headers is expanded at fetch time by the Haskell side rather than at nix eval — this lets a domain ship a working shared default (e.g. an API token) while still honouring the user’s own environment.
Built-in domains:
Gaza / West Bank casualties (Tech for Palestine / Gaza MoH / OCHA), Sudan IPC food crisis (FEWS NET), UCDP conflict events (Uppsala University), Climate TRACE emissions, NOAA space weather. Each ships with the upstream codebook’s context alongside the numbers.
Live demo in any browser:
Runs on a Raspberry Pi 4B over Tailscale Funnel (uplink is still a bit flaky at the moment, so give it another try if the first load doesn’t come through):
Or locally:
nix run gitlab:hunorg/terminal-top
Source:
https://gitlab.com/hunorg/terminal-top
Interested in feedback on the TUI itself — rendering polish, the section vocabulary (stat / sparkline / table / articles / legend / groupCount), layout edge cases on narrow terminals, and ideas for new built-in domains worth adding.
Screenshots:


