Ecosystem sources
Integrations do not pin their ecosystems: caisson.nixos has no
nixpkgs pin, and caisson.home-manager has no home-manager pin. You
pass the ecosystem in, as an argument called the ecosystem source, and
the integration calls the evaluator inside that source. A single
caisson revision therefore works with any nixpkgs, home-manager, or
colmena revision with a compatible evaluation contract, and two
consumers of that same caisson revision can pin different revisions
of each ecosystem.
What a source is
An ecosystem is a community library outside of caisson at the center
of an extensible Nix abstraction framework. Most ecosystems are built
on NixOS modules, but some use other abstractions
(e.g. package sets, lib ecosystems). The ecosystem source is that
project’s source tree or
flake, in whatever shape its evaluator expects. Each integration
documents the shape it takes; in practice:
caisson.nixostakes a nixpkgs source tree (it evaluatesnixos/lib/eval-config.nixfrom it).caisson.home-managertakes a home-manager source tree.caisson.colmena,caisson.terranix, andcaisson.system-managertake their project’s flake (they calllib.makeHive,lib.terranixConfiguration, andlib.makeSystemConfigon it).
How does caisson get access to ecosystem sources?
A source comes from one of three places, in priority order:
- Explicit argument.
ecosystemSrc = inputs.nixpkgsat the call site always wins. - Flake-level default.
ecosystems.nixpkgs = inputs.nixpkgsatmkLibdeclares the composition’s default for that name. - Exact-name input. As a final fallback, an input of the
composing flake named exactly like the ecosystem (
nixpkgs,home-manager, …) is used. Handy for leaf flakes that declare the input anyway.
If none of the three places can provide a needed ecosystem source, it triggers an evaluation error.