Repository navigation
Open
Labels
Description
Description
with flake.nix inputs
opencode.url = "github:anomalyco/opencode/v2.2.0";
opencode.inputs.nixpkgs.follows = "nixpkgs-unstable";nix build fails:
[root@MelDesktop3:/home/melody/Projects/NIXOS]# nixos-rebuild build
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error: Cannot build '/nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/xznlb50w9zkfm95qp3glv2sqr0494sms-opencode-desktop-2.2.0+1097e26
Last 25 log lines:
> node_modules/.bun/ghostty-web@github+anomalyco+ghostty-web+e91e38a/node_modules/ghostty-web/demo/showcase.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/nnm9gdr70ihc6zc9298mzz8jpcgaciql-bash-5.3p20/bin/bash"
> node_modules/.bun/ghostty-web@github+anomalyco+ghostty-web+e91e38a/node_modules/ghostty-web/scripts/build-wasm.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/nnm9gdr70ihc6zc9298mzz8jpcgaciql-bash-5.3p20/bin/bash"
> node_modules/.bun/[email protected]+6c6101fa9d9a1fb4/node_modules/oxlint/bin/oxlint: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/@[email protected]+759ce506b1ed1a42/node_modules/@protobuf-ts/plugin/bin/protoc-gen-dump: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/@[email protected]+759ce506b1ed1a42/node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/oxlint-tsgolint/bin/tsgolint.js: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/regjsparser/bin/parser: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/marked/bin/marked.js: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/commonmark/bin/commonmark: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> patching script interpreter paths in packages/ai/node_modules packages/app/node_modules packages/cli/node_modules packages/client/node_modules packages/codemode/node_modules packages/core/node_modules packages/desktop/node_modules packages/gui-plugins/node_modules packages/http-recorder/node_modules packages/httpapi-codegen/node_modules packages/latex/node_modules packages/merman/node_modules packages/patchmark/node_modules packages/plugin-browser/node_modules packages/plugin/node_modules packages/protocol/node_modules packages/schema/node_modules packages/script/node_modules packages/server/node_modules packages/session-ui/node_modules packages/simulation/node_modules packages/theme/node_modules packages/tui/node_modules packages/ui/node_modules packages/util/node_modules
> $ bun run script/build.ts
> Copied prod icons from ./icons/prod to resources/icons
> Generated metainfo for prod at resources/ai.opencode.desktop.metainfo.xml
> 20 | await $`bun ./script/copy-metainfo.ts ${channel}`
> 21 |
> 22 | const built = await exists(path.join(cli, getCurrentCli().package.replace("@opencode/", "")))
> 23 |
> 24 | if (channel === "prod" && !built)
> 25 | throw new Error(`Production desktop builds bundle the CLI from ${cli}; build it first`)
> ^
> error: Production desktop builds bundle the CLI from /build/source/packages/cli/dist; build it first
> at /build/source/packages/desktop/script/build.ts:25:13
>
> Bun v1.4.2 (Linux x64)
> error: script "build" exited with code 1
For full logs, run:
nix log /nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv
error: Cannot build '/nix/store/mn53crrqjszq8g4iyhwqp8p6js7cfa7w-system-path.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/j1badjm62n5h4m8h538glk6ay48cr6xd-system-path
error: Cannot build '/nix/store/8a5ah7xmawijfsnbfw8ry1s3zajliya2-nixos-system-MelDesktop3-26.11.20261023.3ec6363.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/hzjign2vac4k3wyp4aajcvv56974a16z-nixos-system-MelDesktop3-26.11.20261023.3ec6363
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/etc/nixos#nixosConfigurations."MelDesktop3".config.system.build.toplevel'' returned non-zero exit status 1.
Plugins
N/A
OpenCode version
2.2.0
Steps to reproduce
flake.nix
opencode.url = "github:anomalyco/opencode/v2.2.0";
opencode.inputs.nixpkgs.follows = "nixpkgs-unstable";nix module
environment.systemPackages = [
inputs.opencode.packages.${pkgs.stdenv.hostPlatform.system}.opencode
inputs.opencode.packages.${pkgs.stdenv.hostPlatform.system}.opencode-desktop
];Screenshot
[root@MelDesktop3:/home/melody/Projects/NIXOS]# nixos-rebuild build --verbose --show-trace
debug: nixos_rebuild.process: calling run with args=['nix-instantiate', '--find-file', 'nixos-system'], kwargs={'capture_output': True}, env=None, append_local_env=None
debug: nixos_rebuild.process: captured output with stdout='', stderr="error: file 'nixos-system' was not found in the Nix search path (add it using $NIX_PATH or -I)\n"
building the system configuration...
debug: nixos_rebuild.process: calling run with args=['nix', '--extra-experimental-features', 'nix-command flakes', 'build', '--print-out-paths', '/etc/nixos#nixosConfigurations."MelDesktop3".config.system.build.toplevel', '-v', '--show-trace'], kwargs={'stdout': -1}, env=None, append_local_env=None
warning: Git tree '/etc/nixos' is dirty
these 14 derivations will be built:
/nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv
/nix/store/mn53crrqjszq8g4iyhwqp8p6js7cfa7w-system-path.drv
/nix/store/qychqx8144ll8sz9jdsc2hryqyiwp0ds-dbus-1.drv
/nix/store/bg9byx8g824vz8zwl7bbvdx8xssh910v-X-Restart-Triggers-polkit.drv
/nix/store/cdnb199fqam5xwiz4mdbzggwm4lrr513-unit-polkit.service.drv
/nix/store/w0mnl96dmwpdg0dsqml5afzgpwksdy48-X-Restart-Triggers-dbus-broker.drv
/nix/store/f4b4ij6br7q580mrj5ymdjax9h5gyyf2-unit-dbus-broker.service.drv
/nix/store/q7w9gympf3nzwnqpzb4ls5dyw59acab2-unit-accounts-daemon.service.drv
/nix/store/sh5kq3gkz4jkjd3rwh8p9h8fh5j01mj3-system-units.drv
/nix/store/zs4g2yglsvwhpsd00k8mq5irhdh4d15b-unit-dbus-broker.service.drv
/nix/store/x74r7cgqzij4lbsvdrx90650n1wa6cd4-user-units.drv
/nix/store/pa4zwg5idv3d696a393m5ifgxxg6i7dv-etc.drv
/nix/store/d77hbkvsrcqfc929qckfdp7pdfn4cn7n-activate.drv
/nix/store/8a5ah7xmawijfsnbfw8ry1s3zajliya2-nixos-system-MelDesktop3-26.11.20261023.3ec6363.drv
building '/nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv'...
error: Cannot build '/nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/xznlb50w9zkfm95qp3glv2sqr0494sms-opencode-desktop-2.2.0+1097e26
Last 25 log lines:
> node_modules/.bun/ghostty-web@github+anomalyco+ghostty-web+e91e38a/node_modules/ghostty-web/demo/showcase.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/nnm9gdr70ihc6zc9298mzz8jpcgaciql-bash-5.3p20/bin/bash"
> node_modules/.bun/ghostty-web@github+anomalyco+ghostty-web+e91e38a/node_modules/ghostty-web/scripts/build-wasm.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/nnm9gdr70ihc6zc9298mzz8jpcgaciql-bash-5.3p20/bin/bash"
> node_modules/.bun/[email protected]+6c6101fa9d9a1fb4/node_modules/oxlint/bin/oxlint: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/@[email protected]+759ce506b1ed1a42/node_modules/@protobuf-ts/plugin/bin/protoc-gen-dump: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/@[email protected]+759ce506b1ed1a42/node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/oxlint-tsgolint/bin/tsgolint.js: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/regjsparser/bin/parser: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/marked/bin/marked.js: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> node_modules/.bun/[email protected]/node_modules/commonmark/bin/commonmark: interpreter directive changed from "#!/usr/bin/env node" to "/nix/store/j1j9b0w3mhpccdli73ycj5w7nf6fkzqz-nodejs-24.21.0/bin/node"
> patching script interpreter paths in packages/ai/node_modules packages/app/node_modules packages/cli/node_modules packages/client/node_modules packages/codemode/node_modules packages/core/node_modules packages/desktop/node_modules packages/gui-plugins/node_modules packages/http-recorder/node_modules packages/httpapi-codegen/node_modules packages/latex/node_modules packages/merman/node_modules packages/patchmark/node_modules packages/plugin-browser/node_modules packages/plugin/node_modules packages/protocol/node_modules packages/schema/node_modules packages/script/node_modules packages/server/node_modules packages/session-ui/node_modules packages/simulation/node_modules packages/theme/node_modules packages/tui/node_modules packages/ui/node_modules packages/util/node_modules
> $ bun run script/build.ts
> Copied prod icons from ./icons/prod to resources/icons
> Generated metainfo for prod at resources/ai.opencode.desktop.metainfo.xml
> 20 | await $`bun ./script/copy-metainfo.ts ${channel}`
> 21 |
> 22 | const built = await exists(path.join(cli, getCurrentCli().package.replace("@opencode/", "")))
> 23 |
> 24 | if (channel === "prod" && !built)
> 25 | throw new Error(`Production desktop builds bundle the CLI from ${cli}; build it first`)
> ^
> error: Production desktop builds bundle the CLI from /build/source/packages/cli/dist; build it first
> at /build/source/packages/desktop/script/build.ts:25:13
>
> Bun v1.4.2 (Linux x64)
> error: script "build" exited with code 1
For full logs, run:
nix log /nix/store/1xzsrr5xn4jg6h0kcp67c1idlg224gar-opencode-desktop-2.2.0+1097e26.drv
error: Cannot build '/nix/store/mn53crrqjszq8g4iyhwqp8p6js7cfa7w-system-path.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/j1badjm62n5h4m8h538glk6ay48cr6xd-system-path
error: Cannot build '/nix/store/8a5ah7xmawijfsnbfw8ry1s3zajliya2-nixos-system-MelDesktop3-26.11.20261023.3ec6363.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/hzjign2vac4k3wyp4aajcvv56974a16z-nixos-system-MelDesktop3-26.11.20261023.3ec6363
Traceback (most recent call last):
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/__init__.py", line 445, in main
execute(sys.argv)
~~~~~~~^^^^^^^^^^
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/__init__.py", line 408, in execute
services.build_and_activate_system(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
action=action,
^^^^^^^^^^^^^^
...<6 lines>...
grouped_nix_args=grouped_nix_args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/services.py", line 327, in build_and_activate_system
path_to_config = _build_system(
attr=attr,
...<5 lines>...
grouped_nix_args=grouped_nix_args,
)
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/services.py", line 184, in _build_system
path_to_config = nix.build_flake(
attr,
...<3 lines>...
| grouped_nix_args.flake_eval_flags,
)
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/nix.py", line 95, in build_flake
r = run_wrapper(run_args, stdout=PIPE)
File "/nix/store/7dbpy71z609raq51wv5m226acm62ril3-nixos-rebuild-ng-26.11/lib/python3.14/site-packages/nixos_rebuild/process.py", line 182, in run_wrapper
r = subprocess.run(
final_args,
...<5 lines>...
**kwargs,
)
File "/nix/store/xahxrjs30p3mw0a42bqg9ikgkikskw8m-python3-3.14.8/lib/python3.14/subprocess.py", line 578, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['nix', '--extra-experimental-features', 'nix-command flakes', 'build', '--print-out-paths', '/etc/nixos#nixosConfigurations."MelDesktop3".config.system.build.toplevel', '-v', '--show-trace']' returned non-zero exit status 1.
Operating System
github:NixOS/nixpkgs/nixos-unstable (NixOS 26.11, Linux Kernel 7.2.10)
Terminal
n/a
Activity
opencode-agent commentedon Oct 27, 2026
Thanks for the report. I reproduced this on 2.2.0, and it still happens on the latest
dev(86976449c).Nix isn't available in our sandbox, so the script below replays the relevant part of the
opencode-desktopderivation'sbuildPhaseinstead. Like the derivation, it puts the CLI underOPENCODE_CLI_DISTand then runsbun run buildwithOPENCODE_CHANNEL=prod. It fails with the same error you saw:Production desktop builds bundle the CLI from …/packages/cli/dist; build it first.The likely cause is #59046, which changed
packages/desktop/script/build.tsto look for the CLI only inpackages/cli/distand dropped support forOPENCODE_CLI_DIST.nix/desktop.nixstill puts the CLI there, so the desktop build can't find it.Related: #52863, which notes that the Nix CI check never actually builds the derivation, so breakage like this can go unnoticed.
Reproduction script (nix-desktop-buildphase.sh)
Run it:
bash nix-desktop-buildphase.shchore(upstream-fixes): track the two opencode-desktop workarounds