What problem does this solve?
The flake's only package (default) builds the cbm Makefile target, which links src/ui/embedded_stub.c (no assets). So a binary from nix run/nix shell/nix build has no embedded UI, and codebase-memory-mcp --ui=true refuses to start:
--ui requested, but this binary was built without the embedded UI, so the HTTP server will not start.
There's no Nix-native way to get the UI-embedded server — the cbm-with-ui target runs npm ci && npm run build, which needs network access and so can't run in the build sandbox as wired today. (Distinct from #705, which is about build.sh/make failing in the dev shell on macOS.)
Proposed solution
Add two flake outputs alongside default:
graph-ui — the React frontend built with buildNpmPackage (deps fetched offline from the pinned graph-ui/package-lock.json via npmDepsHash).
codebase-memory-mcp-ui — the server with those assets embedded: drop the prebuilt dist/ into graph-ui/dist, run scripts/embed-frontend.sh directly, then make cbm-with-ui with frontend/embed marked up-to-date (-o) so npm never runs in the sandbox.
Then nix run .#codebase-memory-mcp-ui -- --ui=true serves the UI. Also document both packages in the README. I have this working locally (verified /, JS, and CSS all serve 200 on x86_64-linux) and would like to open a PR.
Alternatives considered
- Fetch npm deps in a fixed-output derivation by hand —
buildNpmPackage already does this and is the idiomatic choice.
- Leave Nix UI-less and point users at
scripts/build.sh --with-ui — works, but Nix users reasonably expect nix run to produce a functioning binary.
Confirmations
What problem does this solve?
The flake's only package (
default) builds thecbmMakefile target, which linkssrc/ui/embedded_stub.c(no assets). So a binary fromnix run/nix shell/nix buildhas no embedded UI, andcodebase-memory-mcp --ui=truerefuses to start:There's no Nix-native way to get the UI-embedded server — the
cbm-with-uitarget runsnpm ci && npm run build, which needs network access and so can't run in the build sandbox as wired today. (Distinct from #705, which is aboutbuild.sh/makefailing in the dev shell on macOS.)Proposed solution
Add two flake outputs alongside
default:graph-ui— the React frontend built withbuildNpmPackage(deps fetched offline from the pinnedgraph-ui/package-lock.jsonvianpmDepsHash).codebase-memory-mcp-ui— the server with those assets embedded: drop the prebuiltdist/intograph-ui/dist, runscripts/embed-frontend.shdirectly, thenmake cbm-with-uiwithfrontend/embedmarked up-to-date (-o) so npm never runs in the sandbox.Then
nix run .#codebase-memory-mcp-ui -- --ui=trueserves the UI. Also document both packages in the README. I have this working locally (verified/, JS, and CSS all serve 200 on x86_64-linux) and would like to open a PR.Alternatives considered
buildNpmPackagealready does this and is the idiomatic choice.scripts/build.sh --with-ui— works, but Nix users reasonably expectnix runto produce a functioning binary.Confirmations