From d298417da7c06e29527866262be5ccdf5f257da7 Mon Sep 17 00:00:00 2001 From: "developing-today[bot]" <347365078+developing-today[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 17:24:38 +0000 Subject: [PATCH] feat(mcpx): addPackageToProfile option; laptop takes the cascade mcpx (#5027) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drew's ruling (2026-11-03): there is one mcpx — the cascade's. The laptop consumer no longer pins services.mcpx.package to this repo's own pkgs/mcpx build; it takes the fork build the module wrapper defaults to, the same derivation the opencode package's bin/mcpx links to. The mcpx home-manager module gains services.mcpx.addPackageToProfile (default true, so no existing consumer changes): the opencode package and the mcpx package are still two buildEnv providers of bin/mcpx — a real file and a symlink to it — so the profile contribution needs an opt-out. The consumer flips it in the follow-up that bumps the openchamber pin through the cascade; setting it before the option reaches this config via the pins would break evaluation here. --- home/common/default.nix | 9 ++++++--- pkgs/mcpx/modules/home-manager.nix | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/home/common/default.nix b/home/common/default.nix index b1eefe781c..9d87d7f1c2 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -916,9 +916,12 @@ in services.mcpx = { # enable comes from the cascade (mkDefault at each layer). # - # This repo's own mcpx build — the package the hand-rolled unit - # ran (pkgs/mcpx) — rather than the fork's re-export default. - package = mcpx; + # package: deliberately unset. There is one mcpx — the + # cascade's (the fork's build, via the module wrapper's + # mkDefault) — and this config takes that one (Drew's ruling, + # 2026-11-03; code#5027). The former pin to this repo's own + # pkgs/mcpx build made two mcpx builds coexist and collided + # with the fork package's bin/mcpx in the home profile. # The daemon's environment, unchanged from the hand-rolled unit # (mcpxEnvironment above). environment = mcpxEnvironment; diff --git a/pkgs/mcpx/modules/home-manager.nix b/pkgs/mcpx/modules/home-manager.nix index 7c922c66a9..709afacabe 100644 --- a/pkgs/mcpx/modules/home-manager.nix +++ b/pkgs/mcpx/modules/home-manager.nix @@ -26,10 +26,25 @@ in { imports = [ ./common.nix ]; + options.services.mcpx.addPackageToProfile = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether the module adds `package` to `home.packages`, putting + `bin/mcpx` on the profile PATH. Turn it off when another + package in the profile already provides `bin/mcpx` — the fork + opencode package's `bin/mcpx` is a link to this very build, and + home-manager's buildEnv still counts the package and the link + as two providers of the same path (code#5027). The daemon is + unaffected either way: the service definition runs `package` + directly, never through the profile. + ''; + }; + config = lib.mkIf cfg.enable ( lib.mkMerge [ { - home.packages = [ cfg.package ]; + home.packages = lib.mkIf cfg.addPackageToProfile [ cfg.package ]; # Point every other mcpx client at the same config the # daemon runs, two ways: MCPX_CONFIG in the session