couple fixes
This commit is contained in:
87
modules/home/programs/opencode/default.nix
Normal file
87
modules/home/programs/opencode/default.nix
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.${namespace}.programs.opencode;
|
||||
in
|
||||
{
|
||||
options.${namespace}.programs.opencode = {
|
||||
enable = lib.mkEnableOption "opencode";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets."hass-mcp/token" = { };
|
||||
|
||||
sops.templates."hass-mcp.env" = {
|
||||
mode = "0600";
|
||||
content = ''
|
||||
HA_URL=http://nuc-nixos.local:8123
|
||||
HA_TOKEN=${config.sops.placeholder."hass-mcp/token"}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
enableMcpIntegration = true;
|
||||
settings = {
|
||||
provider = {
|
||||
nas = {
|
||||
npm = "@ai-sdk/openai-compatible";
|
||||
name = "llama-server (local)";
|
||||
options = {
|
||||
baseURL = "http://jallen-nas.local:8127/v1";
|
||||
};
|
||||
models = {
|
||||
Qwen3-Coder-Next-Q4_0 = {
|
||||
name = "Qwen3 Coder (local)";
|
||||
modalities = {
|
||||
input = [
|
||||
"image"
|
||||
"text"
|
||||
];
|
||||
output = [ "text" ];
|
||||
};
|
||||
limit = {
|
||||
context = 262144;
|
||||
output = 262144;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
nixos = {
|
||||
command = "nix";
|
||||
args = [
|
||||
"run"
|
||||
"github:utensils/mcp-nixos"
|
||||
"--"
|
||||
];
|
||||
};
|
||||
hass-mcp = {
|
||||
command = "bash";
|
||||
args = [
|
||||
"-c"
|
||||
"set -a; source ${config.sops.templates."hass-mcp.env".path}; set +a; exec uvx hass-mcp"
|
||||
];
|
||||
};
|
||||
mcp-server-code-runner = {
|
||||
command = "${pkgs.nodejs_24}/bin/npm";
|
||||
args = [
|
||||
"-y"
|
||||
"mcp-server-code-runner@latest"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user