overengineeringstudio / overengineeringstudio/effect-utils

Adopt dynamic derivations for pnpmDepsHash once Nix support is production-ready

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:nix area:nix-hash origin:agent type:feature
Dominant language
TypeScript
Stars
82
Forks
2
Avg merge
1d 8h
Merged PRs (30d)
121

Description

Context

Issue #409 identified two separate tracks:

  1. a short-term fix to make dt nix:hash:* update more than one stale fixed-output hash per iteration
  2. a long-term design to eliminate manual pnpmDepsHash maintenance 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 pnpmDepsHash call sites:
    • packages/@overeng/genie/nix/build.nix
    • packages/@overeng/megarepo/nix/build.nix
    • nix/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 as dynamic-derivations and ca-derivations.
  • Upstream tracking is still open:
    • NixOS/nix#6316 (dynamic derivations tracking issue) is still open under the dynamic-derivations stabilisation milestone.
    • NixOS/nix#8602 was explicitly called out by maintainers as necessary for practical usability/stabilisation.
  • This approach would remove manual pnpmDepsHash maintenance after evaluation succeeds, but it would not solve the separate failure mode where flake.lock is itself broken and flake evaluation cannot start.
  • The existing code in mk-pnpm-deps.nix already 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

  1. Build a narrow proof-of-concept in mk-pnpm-deps.nix that computes the dependency-store output through a generated derivation and builtins.outputOf.
  2. Validate whether the design works for all current consumers (genie, megarepo, oxc-config-plugin) without changing their staged inputs.
  3. Measure the tradeoff for:
    • downstream flake consumers
    • binary cache behavior
    • CI reproducibility
    • local developer ergonomics
  4. Only switch the shared default once the experimental-feature requirement and upstream stabilisation risk are acceptable.

Sources

Acting on behalf of the user.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.