Skip to content

home profile: bin/opencode collision — consumer wrapper vs cascade opencode package blocks the generation build #5038

Closed

Description

@developing-today

Found while implementing the #5027 fix (PR #5037): with the bin/mcpx collision resolved, the laptop's home-manager generation build stops at a second profile collision that was masked behind the first.

The two providers of bin/opencode in evaluated home.packages (nixosConfigurations.amd, user):

  • /nix/store/g6hvhvzhpl05pcf2nfysvkc2nwmps0m6-opencode — this repo's consumer wrapper: (pkgs.writeShellScriptBin "opencode" …) in home/common/default.nix (the home.packages list, ~line 1530). It injects Cloudflare (~/.config/cloudflare/*) and Jules credentials into the environment, kicks a daily background sync-models, and execs inputs.opencode.packages.<system>.opencode — the root opencode input, pin d66c71f5 (2.0.30+d66c71f).
  • /nix/store/b6mr9fv22rzajmpbnrib633945gmc1df-opencode-2.0.30+2d912e0 — the cascade's opencode package, added to home.packages by services.opencode's home-manager module (openchamber f46050fc → opencode fork 2d912e02).

Both ship a real, distinct bin/opencode file:

pkgs.buildEnv error: two given paths contain a conflicting subpath:
  `/nix/store/g6hvhvzhpl05pcf2nfysvkc2nwmps0m6-opencode/bin/opencode' and
  `/nix/store/b6mr9fv22rzajmpbnrib633945gmc1df-opencode-2.0.30+2d912e0/bin/opencode'

Pre-existing: both packages are present in unmodified main's evaluated home.packages at today's pins. In deploy round 2 (pin 8912c837e) buildEnv reported the bin/mcpx conflict first, masking this one. It blocks the laptop cascade deploy (round 3) independently of #5027.

Shape of the decision — the same pattern as mcpx (Drew: "just enable openchamber and take that one"), except the wrapper carries behavior the cascade package doesn't:

  • lib.hiPrio the wrapper, so it wins bin/opencode in the profile (smallest change; both builds stay installed; the cascade package's other files still link).
  • Gate the fork module's profile contribution instead — an addPackageToProfile-style option in the opencode fork, like the one PR feat(mcpx): addPackageToProfile option; laptop takes the cascade mcpx (#5027) #5037 adds for mcpx in this repo — and keep the wrapper as the profile's only opencode.
  • Drop the wrapper and take the cascade package as-is, moving its env injection + model sync elsewhere (session environment / a unit). Note the wrapper also execs a different fork rev (d66c71f5) than the service runs (2d912e02), so this option also unifies which build the CLI is.

Not decided here — filed so the deploy blocker is tracked with its evidence.

Activity

  1. developing-today commented on Nov 3, 2026

    @developing-today
    ContributorAuthor

    Ruling recorded (Drew, 2026-11-03): option A — wrap the cascade opencode package.

    The consumer config keeps services.openchamber.enable = true; untouched and gains exactly one line, services.opencode.package = opencodeWrapped;. The wrapped derivation is a symlinkJoin over the cascade package — openchamber's nested opencode input, the very derivation the module mkDefaults — with the existing wrapper script baked in as bin/opencode; the rest of the tree (above all bin/mcpx) rides along untouched. The wrapper leaves home.packages; its logic is unchanged except it now execs the cascade build instead of the root input's build, so CLI and service are one build, and the wrapper's env top-ups (incl. JULES_API_KEY) now reach the server process too.

    Implementation: PR #5077 — #5077

    Evidence at the PR's base (bca5683bf; pins openchamber e1e8bc3d, nested opencode 12acd9f2): wrapped package builds with the wrapper as bin/opencode exec'ing the exact no-override default store path; the home.packages census diff is exactly {-cascade, -standalone wrapper, +wrapped} (456 -> 455); and home.activationPackage builds GREEN — with the mcpx chain's addPackageToProfile = false (PR #5074) already in, this was the last profile collision, so the home-manager generation that died in deploy rounds 1-2 now builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions