overengineeringstudio / overengineeringstudio/effect-utils
Adopt dynamic derivations for pnpmDepsHash once Nix support is production-ready
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 82
- Forks
- 2
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 121
Description
Context
Issue #409 identified two separate tracks:
- a short-term fix to make
dt nix:hash:*update more than one stale fixed-output hash per iteration - a long-term design to eliminate manual
pnpmDepsHashmaintenance entirely
The short-term fix is being handled separately. This issue tracks the long-term design work.
Findings from #409
- The current repo has three repo-local
pnpmDepsHashcall sites:packages/@overeng/genie/nix/build.nixpackages/@overeng/megarepo/nix/build.nixnix/oxc-config-plugin.nix
- The shared FOD boundary is centralized in
nix/workspace-tools/lib/mk-pnpm-deps.nix, so any long-term change should be designed around that helper first. - Nix dynamic/computed derivations are technically relevant here via
builtins.outputOf, but they still require experimental features such asdynamic-derivationsandca-derivations. - Upstream tracking is still open:
NixOS/nix#6316(dynamic derivations tracking issue) is still open under thedynamic-derivations stabilisationmilestone.NixOS/nix#8602was explicitly called out by maintainers as necessary for practical usability/stabilisation.
- This approach would remove manual
pnpmDepsHashmaintenance after evaluation succeeds, but it would not solve the separate failure mode whereflake.lockis itself broken and flake evaluation cannot start. - The existing code in
mk-pnpm-deps.nixalready points in this direction with a TODO to replace manual FOD hashes once content-addressed / production-ready support exists.
Constraints
- Do not require unstable Nix features for downstream consumers unless we decide that intentionally.
- Keep the current staged workspace / lockfile-driven behavior intact.
- Avoid introducing a second dependency-fetch path that can drift from the real build inputs.
Proposed next steps
- Build a narrow proof-of-concept in
mk-pnpm-deps.nixthat computes the dependency-store output through a generated derivation andbuiltins.outputOf. - Validate whether the design works for all current consumers (
genie,megarepo,oxc-config-plugin) without changing their staged inputs. - Measure the tradeoff for:
- downstream flake consumers
- binary cache behavior
- CI reproducibility
- local developer ergonomics
- Only switch the shared default once the experimental-feature requirement and upstream stabilisation risk are acceptable.
Sources
- #409
- https://github.com/NixOS/nix/issues/6316
- https://github.com/NixOS/nix/issues/8602
- https://github.com/NixOS/nix/pull/10734
Acting on behalf of the user.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TODO and shared fixed-output derivation boundary in nix/workspace-tools/lib/mk-pnpm-deps.nix, then inspect the call sites in packages/@overeng/genie/nix/build.nix, packages/@overeng/megarepo/nix/build.nix, and nix/oxc-config-plugin.nix. Build and validate the proposed proof of concept with the current staged inputs, including all three consumers. Done means the tradeoffs are documented and a shared default can be adopted without requiring unacceptable experimental Nix features.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, infrastructure
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100