Skip to content

make opencode work w/ NixOS #3540

@pmarreck

Description

@pmarreck

Description

Installed OpenCode via 'npm install -g --prefix "$HOME/.local" opencode-ai@latest'.

Ran it and got this:

bash> opencode
Could not start dynamically linked executable: opencode
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

There is an "opencode" on nixpkgs but it is an extremely old version at this point.

Making assumptions about what's available on a linux install at runtime just because you're running on "a linux" is bad design. Neither codex nor gemini nor claude (all of which I have installed identically to the method above; they're available on nixpkgs, but the above method keeps them always at the bleeding edge) make this assumption and all run just fine.

Even better, perhaps someone should update the version on nixpkgs on a more regular basis, but none of the others do that either, so that's probably a big ask. ;)

https://search.nixos.org/packages?channel=25.05&show=opencode&query=opencode

OpenCode version

Latest

Steps to reproduce

  1. be on the ultimate linux distro, NixOS
  2. install opencode using npm
  3. try to run it

Screenshot and/or share link

No response

Operating System

NixOS 25.05

Terminal

Wezterm

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions