Skip to content

Nix CLI build fails: missing packages/app dependencies for web UI embedding #19307

@jerome-benoit

Description

@jerome-benoit

Description

The Nix CLI build (nix/opencode.nix) fails because build.ts embeds the web UI by default (bun run --cwd ${appDir} build), which invokes packages/app/node_modules/.bin/vite.

However, nix/node_modules.nix only installs dependencies for packages/opencode and packages/desktop:

bun install \
  --filter '!./' \
  --filter './packages/opencode' \
  --filter './packages/desktop' \

So packages/app/node_modules doesn't exist in the build sandbox — vite is missing entirely.

Root cause: nix/node_modules.nix is missing --filter './packages/app', and nix/opencode.nix is missing patchShebangs for packages/app/node_modules (like nix/desktop.nix already does for its own node_modules).

Suggested fix:

  1. Add --filter './packages/app' to nix/node_modules.nix so app dependencies are available
  2. Add patchShebangs packages/app/node_modules and nodejs to nativeBuildInputs in nix/opencode.nix (same pattern as nix/desktop.nix)

OpenCode version

1.3.3 at rev 9a2482ac09c03d32d9331a84b8b8bd137301ead0

Steps to reproduce

nix build github:anomalyco/opencode

Operating System

NixOS / any Nix-based system (Linux x86_64)

/nix/store/.../bash: /build/source/packages/app/node_modules/.bin/vite: /usr/bin/env: bad interpreter: No such file or directory
error: script "build" exited with code 126

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions