From ad4369b656d38edfef0afe6355a4abd2ac8714a4 Mon Sep 17 00:00:00 2001 From: Jakob Ankarhem Date: Fri, 4 Sep 2026 15:42:37 +0200 Subject: [PATCH] feat(opencode): add opencode2 beta alongside v1 opencode2 runs side by side as its own binary and reads the same opencode.json; the native v2 'plugins' key installs the ported opencode2-direnv plugin and is ignored by v1. --- modules/ai/opencode/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/ai/opencode/default.nix b/modules/ai/opencode/default.nix index 95fbb26..bf5e2e9 100644 --- a/modules/ai/opencode/default.nix +++ b/modules/ai/opencode/default.nix @@ -15,6 +15,12 @@ in ]; _module.args.inputs = inputs; + # OpenCode 2 (beta) runs side by side with v1 as `opencode2` and reads + # the same config; the v2-native `plugins` key below only affects v2. + home.packages = [ + inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.opencode2 + ]; + programs.opencode = { enable = true; package = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.opencode; @@ -37,6 +43,8 @@ in "@simonwjackson/opencode-direnv" "@ex-machina/opencode-anthropic-auth" ]; + # native v2 plugin config (only read by opencode2) + plugins = [ "opencode2-direnv" ]; model = glm; small_model = glmFlash; -- 2.54.0