flake: instantiate the entrypoint once per system #6
Loading…
Reference in a new issue
No description provided.
Delete branch "hoist-flake-entrypoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The flake wrapper applied the entrypoint once per
(attr, system)pair.importmemoizes the file value, not the application, so none of those applications shared any of the entrypoint's internal work -- each re-ran the wholelet, including thepkgs ? import sources.nixpkgs { ... }default argument, i.e. a whole fresh nixpkgs.Binding one instantiation per system in the
letand reading every keyed output out of it collapses that.Measured on
fediversity-ci,nix flake show --no-eval-cache, warm store, second of two runs:Output is unchanged:
nix flake show --json --all-systems --no-eval-cache | jq -S .is byte-identical before and after, and everydrvPathis unmoved bar thetreefmtcheck's, which hashes the project source and so moves with any edit toflake.nixitself.This is the same defect that cost the fediversity monorepo far more (its entrypoints carry a whole deployment surface, not just a nixpkgs); the wrapper was copied from https://codeberg.org/kiara/poc-override-nix-deps, which is being fixed at the source too.