Skip to content

NixOS: custom tools fail because they cannot find imported modules #5914

Closed as not planned

Description

@JoshuaDietz

Description

On NixOS after configuring custom tools, for any message that I sent I only got error messages like

cannot find module '@opencode-ai/plugin' (when I tried to symlink my tools from my nixOS repo into the Opencode config repo)

and

ENOENT reading "/nix/store/somethingsomething...-opencode-.1.0.184/lib/opencode/node_modules/@opencode-ai/plugin/node_modules/zod" (when I let NixOS copy my tools from my NixOS repo into the Opencode config dir on rebuild)

After much trying around I've managed to make it work on my fork:

dev...JoshuaDietz:opencode:try-fix-nixos-plugins

But since I'm not experienced at all with NixOS packaging I honestly have no idea if this is a clean way to do it and if it's worth a PR. But I hope that it can maybe at least be a starting point for someone more competent than me 😆

OpenCode version

1.0.184

Steps to reproduce

  1. Install Opencode on NixOS with opencode.url = "github:sst/opencode (in flake.nix)
  2. Add a custom tool as described here: https://opencode.ai/docs/custom-tools
  3. Talk to Opencode in TUI mode. Immediately when sending a message I got one of the errors above

Screenshot and/or share link

No response

Operating System

NixOS 25.11

Terminal

Konsole

Activity

  1. megalithic commented on Dec 27, 2025

    @megalithic

    getting this one too

  2. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  3. dani0854 commented on Apr 10, 2026

    @dani0854

    I have same problem, have to copy custom tools instead of linking them.

  4. removed
    bugSomething isn't working
    on May 3, 2026
  5. ElnuDev commented on Nov 10, 2026

    @ElnuDev

    @rekram1-node I'm not sure if you closed this because it looks like it's a NixOS-specific issue, but it isn't. #11001 is the same problem reported on macOS. (I don't know why the post author closed that issue as completed, no solution was given.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions