feat: add opencode
This commit is contained in:
@@ -22,6 +22,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
terminal = {
|
terminal = {
|
||||||
|
opencode = enabled;
|
||||||
btop = enabled;
|
btop = enabled;
|
||||||
direnv = enabled;
|
direnv = enabled;
|
||||||
git = enabled;
|
git = enabled;
|
||||||
@@ -43,7 +44,6 @@ in
|
|||||||
texliveSmall # Pandoc PDF Dep
|
texliveSmall # Pandoc PDF Dep
|
||||||
google-cloud-sdk
|
google-cloud-sdk
|
||||||
tldr
|
tldr
|
||||||
opencode
|
|
||||||
claude-code
|
claude-code
|
||||||
reichard.qwen-code
|
reichard.qwen-code
|
||||||
];
|
];
|
||||||
|
|||||||
56
modules/home/programs/terminal/opencode/default.nix
Executable file
56
modules/home/programs/terminal/opencode/default.nix
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
{ lib
|
||||||
|
, config
|
||||||
|
, namespace
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.${namespace}.programs.terminal.opencode;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.${namespace}.programs.terminal.opencode = {
|
||||||
|
enable = lib.mkEnableOption "enable opencode";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.opencode = {
|
||||||
|
enable = true;
|
||||||
|
enableMcpIntegration = true;
|
||||||
|
settings = {
|
||||||
|
theme = "catppuccin";
|
||||||
|
provider = {
|
||||||
|
"llama-swap" = {
|
||||||
|
npm = "@ai-sdk/openai-compatible";
|
||||||
|
options = {
|
||||||
|
baseURL = "https://llm-api.va.reichard.io/v1";
|
||||||
|
};
|
||||||
|
models = {
|
||||||
|
"gpt-oss-20b-thinking" = {
|
||||||
|
name = "GPT OSS (20B)";
|
||||||
|
};
|
||||||
|
qwen3-coder-30b-instruct = {
|
||||||
|
name = "Qwen3 Coder (30B)";
|
||||||
|
};
|
||||||
|
qwen3-30b-2507-thinking = {
|
||||||
|
name = "Qwen3 2507 (30B) Thinking";
|
||||||
|
};
|
||||||
|
qwen3-30b-2507-instruct = {
|
||||||
|
name = "Qwen3 2507 (30B) Instruct";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
mcp = {
|
||||||
|
gopls = {
|
||||||
|
type = "local";
|
||||||
|
command = [
|
||||||
|
"gopls"
|
||||||
|
"mcp"
|
||||||
|
];
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user