Flake inputs and discovery
How modules enter the Nix evaluation and where their versions are locked.
A consumer imports an external module by adding its flake as an input. For example:
{
inputs.stackpanel.url = "github:darkmatter/stackpanel";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.playwright.url = "github:darkmatter/stackpanel-registry?dir=modules/playwright";
outputs = inputs: inputs.stackpanel.lib.mkFlake { inherit inputs; };
}Stackpanel inspects direct inputs other than self and stackpanel, importing each stackpanelModules.default. A project can also contribute tracked modules under .stack/modules/ and .stack/nix/. Imports extend the option schema even before the module contributes enabled behavior. Put behavior and derivations behind the module's activation condition.
For explicit selection, set stackpanel.autoImportInputs = false in the flake-parts configuration and provide stackpanel.imports = [ inputs.playwright.stackpanelModules.default ];. With stackpanel.lib.mkFlake, stackpanelImports supplies the same explicit imports. A module can have another output path; the catalog's flakePath is an attribute path within that input, not a filesystem path in the consumer. ?dir=... selects the directory containing flake.nix.
Flake-level contributions
An extension may export stackpanelModuleMeta.overlays and stackpanelModuleMeta.flakeModules. These are known before the consumer creates pkgs or evaluates its project options. Keep them independent of the consumer's module enable flag. A stackpanelModuleMeta.followsNixpkgs declaration describes the preferred input wiring; never add a nixpkgs follow to a flake that has no such input.
Declare dependencies of the extension itself in its flake. If a module also needs inputs on the consumer flake, list them in the module's flakeInputs and the corresponding catalog version. The installer reconciles those declarations before enabling the module. It rolls back an install that still reports missing inputs rather than fetching additional sources the catalog did not advertise.
Version control
flake.nixnames inputs, selected refs, follows, and any explicit imports.flake.lockrecords resolved revisions and content hashes. Commit both.stack module updatechanges the selected project's lock; reading a catalog does not update anything.- During development,
stack module linksupplies a machine-local--override-inputfor an existing input. Other developers and CI keep using the lock. Unlink and test the locked version before releasing. - A file in the working tree of a Git flake must be tracked to be visible in a pure evaluation. No
--impureflag is required for authoring or installing a module.