Skip to content

Record where each part of the stack came from - #129

Merged
clhodapp merged 2 commits into
mainfrom
feat/ecosystems-record
Oct 24, 2026
Merged

clhodapp merged 2 commits into
mainfrom
feat/ecosystems-record

Conversation

@clhodapp

@clhodapp clhodapp commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Builds on nix-caisson/caisson-core#54, merged, which records defaultEcosystemSrcNames on the lib manifest. The locks pin caisson-core main at its merge commit, 68fe584.

Every configuration records ecosystems: an account for each part of the stack its evaluation used, keyed as the parts are resolved. This is item 4 of what topside needs from the record, and design section 5 lists it.

{
  nixpkgs-lib = { from = "defaultEcosystemSrc"; source = "nixpkgs"; };
  nixos = { from = "ecosystemSrc"; source = "nixpkgs"; };
}
  • from names the declaration that supplied the source: ecosystemSrc for the configuration's selection, defaultEcosystemSrc for the tree's, and sources for the source pinned under exactly that name.
  • source is the name of that source among the pinned sources, where sources.<name>.pin records its revision. It is null where a selection builds the value in another way.
  • lib.caisson.integrations.ecosystemAccountOf computes an account from the arguments resolveEcosystemSrc takes. mkModuleConfiguration records nixpkgs-lib for every evaluation, and each integration's evaluate returns the ecosystems it resolves, with the same arguments it resolves them with. Every integration that resolves a source records it: nixos and nixos-minimal, home-manager, darwin, system-manager, colmena and caisson-colmena, disko and caisson-disko, hjem, nixvim, nvf, nixidy, treefmt, flake-parts, kubenix, topology and terranix.
  • A package config records nixpkgs-lib and nixpkgs. Its nixpkgs entry also lists libraries, the top-level names its sets take from the package set's source.

A fix in flake-parts. Since #128, a flake-parts configuration that passed ecosystemSrc threw. The selected source went back into resolveEcosystemSrc, which takes a function. flake-parts now resolves a selected source once. structuralTopMatchesFlakeParts covers it.

Tests: ecosystemsRecordWhereEachPartCameFrom and ecosystemsRecordWhereEachIntegrationsPartsCameFrom in the pinned-world suite, assertions in the existing test of each integration, and nixpkgs-lib-only for the package config, including a library that names no pinned source. The full nix flake check passes, VM tests included.

🤖 Generated with Claude Code

Every configuration records ecosystems: an account for each part of
the stack its evaluation used, keyed as the parts are resolved. Each
account names the declaration that supplied the source (the
ecosystemSrc of the configuration, the defaultEcosystemSrc of the
tree, or the source pinned under exactly that name) and the name of
that source among the pinned sources. nixpkgs-lib is recorded for
every evaluation, each integration adds the ecosystems it resolves,
and a package config also lists the names its sets take from the
source of the package set.

flake-parts resolves a selected source once. A flake-parts
configuration that passed ecosystemSrc threw, because the selected
source went back into resolveEcosystemSrc, which takes a function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clhodapp
clhodapp merged commit a2e5dfe into main Oct 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant