You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Jason Bowman
sini
Infrastructure engineer building den + gen: declarative fleet configuration for Nix backed by programming language theory.
A self-contained flake that exercises every gen library in a realistic scenario: a web application deployment with environments, hosts, services, policies, settings composition, and queries. Not a toy — a miniature version of what den v2 will do.
Den pragmatic fleet features — learning from Clan-core, bridging strategy, five spikes, aspect library roadmap
Den Pragmatic Fleet Features — Learning from Clan, Bridging Strategy
Date: 2026-05-27
Companion to:2026-05-27-clan-gen-integration-analysis.md (what gen offers Clan)
This document: What den should borrow (functional gaps only), the bridging strategy, and the roadmap.
Framing
Den and Clan solve overlapping problems differently. Den has ~100s of users and strong formal foundations: scope graphs, algebraic composition, demand-driven evaluation, multi-class output, and the ability to materialize any output target (NixOS, darwin, homeManager, terraform, devshells, packages, treefmt, nix-unit, flake-parts perSystem) from a single aspect graph. Clan has a slightly larger user base and launched earlier, but forces NixOS module evaluation for every entity and can only target nixos/darwin.
Gen ecosystem integration opportunities for Clan-core — scope graphs, typed registries, and rule dispatch for fleet management
Gen Ecosystem Integration Opportunities for Clan-core
Date: 2026-05-27
Context: Analysis of clan-core architecture against the gen library ecosystem to identify where gen's formal foundations could strengthen Clan's fleet management.
Background
Clan-core is a mature Nix framework for declarative multi-host fleet management. It provides an inventory-driven model where machines are declared, services define roles, and instances bind roles to machines. 30+ production services ship with the framework, alongside a CLI, GUI app, and Python tooling ecosystem. It uses flake-parts, NixOS modules, and a structured scope key system (buildScopeKey/checkScope) for export isolation.
Gen is an eight-library ecosystem providing formal foundations for configuration composition: scope graphs (Neron 2015), algebraic graph composition (Mokhov 2017), demand-driven attribute grammar evaluation (Vogt 1989, Sloane 2010), intensional id
gen-derive: stratified rule dispatch with fixpoint convergence — guarded graph rewrite rules for Nix
gen-derive — Stratified Rule Dispatch with Fixpoint Convergence
Date: 2026-05-25
Status: Draft
Depends on: gen (pure tier: mkIntensional, intensionalEq) for core; gen-select for adapter tier
Purpose
gen-derive is a rule dispatch engine for guarded graph transformations. Given a set of rules (condition + action producer), a position in a graph, and a context, gen-derive answers: "which rules fire here, and what actions do they produce?" It owns the dispatch protocol, phase ordering, fixpoint convergence, conflict resolution, and rule dedup. It does NOT own the action vocabulary — actions are opaque tagged values whose semantics belong to the caller.
gen-select: selector algebra for attributed graph positions
gen-select — Selector Algebra for Attributed Graph Positions
Date: 2026-05-25
Status: Approved
Depends on: gen (pure tier only: mkIntensional, intensionalEq)
Purpose
gen-select is a pattern-matching library for attributed graph positions. Given a node and its graph context (expressed as accessor functions), a selector answers: "does this node match?" Pure library — no knowledge of NixOS, aspects, scopes, or configuration. Consumers bring their own graph topology via accessor functions.
gen-bind: module binding with external arguments — inject scope-computed values into NixOS module functions
gen-bind: Module Binding with External Arguments
A standalone library for injecting external bindings into NixOS/home-manager module functions. Handles partial application, merge conflict detection, lazy contracts, provenance tracking, thunk deferral, signature inference, identity wrapping, and binding arg stripping. The bridge between "scope-computed values" and "the NixOS module system."
Problem Statement
NixOS module functions take { config, lib, pkgs, options, ... }: — arguments provided by evalModules. External systems (scope-graph evaluators, rule engines, configuration generators) compute additional context that modules need: structural data (host, user), computed flags (isNixos, isDarwin), and aggregated data (firewall, http-backends).
Today this is done by den's class-module.nix (~250 lines) and wrap-classes.nix (~190 lines). The logic is generic — it has no knowledge of aspects, policies, or scope graphs. It only knows: "here's a module function, here are extra args, mak
den: homeManager + nix-maid cross-compatibility test suite — verifies both classes route independently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters