Skip to content

Make defaultEcosystemSrc a selection from the tree's sources - #53

Merged
clhodapp merged 1 commit into
mainfrom
feat/sources-selections
Oct 22, 2026
Merged

clhodapp merged 1 commit into
mainfrom
feat/sources-selections

Conversation

@clhodapp

Copy link
Copy Markdown
Contributor

mkLib's defaultEcosystemSrc is now a function of sources that returns the source of each ecosystem by its exact name, the way defaultPkgs is a function of the package sets:

defaultEcosystemSrc = sources: { nixpkgs-lib = sources.nixpkgs; nixos = sources.nixpkgs; };

So the sources a tree uses are the sources it pins, and the record can name each by the key it is pinned under. mkLib applies the function to sources and keeps the result where it kept the attribute set before, so ecosystemSrc <name> and the manifest's defaultEcosystemSrc read as they did. An attribute set is refused, with the function form in the message.

This is a breaking change for every mkLib caller that passes defaultEcosystemSrc. The companion caisson PR, on caisson's branch feat/separate-nixpkgs-parts, makes ecosystemSrc a selection too and stops falling back between the nixpkgs-lib, nixpkgs and nixos keys. The workspace consumers follow it.

Tests. The hermetic tests select their fixtures from sources. The shape test, now lifecycleDefaultEcosystemSrcMustBeASelection, checks that a number, an attribute set, and a function returning a non-attribute-set are all refused. The suite passes, 129 tests, and so does nix flake check.

🤖 Generated with Claude Code

`mkLib`'s `defaultEcosystemSrc` is now a function of `sources` that
returns the source of each ecosystem by its exact name, as
`defaultPkgs` is a function of the package sets:

    defaultEcosystemSrc = sources: { nixpkgs-lib = sources.nixpkgs; };

so the sources a tree uses are the sources it pins. mkLib applies it
to `sources` and holds what it selected where it held the attribute
set before, so `ecosystemSrc <name>` and the manifest's
`defaultEcosystemSrc` read as they did. An attribute set is refused,
with the function form in the message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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