Make Nix commands faster with npins - #753
Draft
srid wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emanote's root flake exposed every dependency through the flake input graph, so routine commands paid to verify that graph and traverse the nixos-unified/flake-parts composition before reaching the output they needed. This PR moves the exact same revisions to npins and evaluates haskell-flake through its standalone library API.
The result is a smaller hot path for both development and execution. Formatting hooks now live in a dedicated
.#fmtshell, while runtime outputs skip construction of the Haskell development shell.nix develop -c truenix develop -c truenix develop -c truenix run . -- --helpnix run . -- --helpnix run . -- --helpEach number is the median of five runs on x86_64-linux with Nix 2.34.7. The forced uncached app evaluation regression is retained and called out explicitly: the normal repeated app path is 40ms faster, while fresh-client-cache behavior is effectively unchanged. The full Ralph report includes raw samples, methodology, every rejected experiment, and the stopping rule.
The root flake now has zero inputs.
flake.lockbecomesnpins/sources.json; all dependency revisions match the old lock. Private flake-parts modules are replaced by focused standalone modules for the Haskell project, diagrams, hooks, and system outputs. The public Emanote-siteflakeModuleremains exported and unchanged for downstream consumers. The Playwright and Chrome DevTools shells also read their pins from npins.Compatibility evidence:
apps.x86_64-linux.default.programresolves to the identical baseline store path.devShells.fmtis additive.nix flake check --option allow-import-from-derivation truepasses all five checks.nix run,nix shell,nix develop,tests/shell.nix, andnix/chrome-devtools/shell.nixall pass their smoke tests.Try it locally
nix develop github:srid/emanote/agent/nix-eval-performance -c true nix run github:srid/emanote/agent/nix-eval-performance -- --helpUpdate pins with
npins update, or target one pin withnpins update nixpkgs-latest.Generated by Codex (model
gpt-5.6-sol).