diff --git a/modules/home/terminal/opencode/default.nix b/modules/home/terminal/opencode/default.nix index 1fa74cc..1d8634d 100644 --- a/modules/home/terminal/opencode/default.nix +++ b/modules/home/terminal/opencode/default.nix @@ -2,8 +2,11 @@ lib, config, pkgs, + osConfig, ... -}: { +}: let + a2a = osConfig.mods.server.auth2api; +in { options.mods.opencode.enable = lib.mkEnableOption "enables opencode"; # imports = [ @@ -21,6 +24,16 @@ settings = { "plugin" = ["opencode-gemini-auth" "opencode-anthropic-oauth"]; + "provider" = { + "auth2api" = { + "npm" = "@ai-sdk/openai-compatible"; + "name" = "auth2api (local)"; + "options" = { + "baseURL" = "http://${a2a.host}:${toString a2a.port}/v1"; + }; + }; + }; + "mode" = { "build" = { "prompt" = "You are Claude Code, Anthropic's official CLI for Claude.";