72 lines
2.0 KiB
Nix
72 lines
2.0 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
inputs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
# Paths to agenix-decrypted secrets (same on Darwin and NixOS)
|
|
githubToken = "/run/agenix/github-token";
|
|
anthropicToken = "/run/agenix/anthropicToken";
|
|
|
|
# github-mcp-server binary path from nixpkgs
|
|
githubMcpServer = "${pkgs.github-mcp-server}/bin/github-mcp-server";
|
|
in
|
|
{
|
|
home.packages = [
|
|
pkgs.github-mcp-server
|
|
inputs.llm-agents.packages.${pkgs.system}.opencode
|
|
inputs.llm-agents.packages.${pkgs.system}.tuicr
|
|
inputs.llm-agents.packages.${pkgs.system}.chainlink
|
|
];
|
|
|
|
# OpenCode configuration directory
|
|
xdg.configFile = {
|
|
"opencode/opencode.json".text = builtins.toJSON {
|
|
"$schema" = "https://opencode.ai/config.json";
|
|
theme = "ayu-mirage";
|
|
autoupdate = false;
|
|
permission = {
|
|
external_directory = "allow";
|
|
# Restrict session-search skill to archivist only
|
|
skill = {
|
|
"session-search" = "deny";
|
|
};
|
|
};
|
|
provider = {
|
|
anthropic = {
|
|
options = {
|
|
apiKey = "{file:${anthropicToken}}";
|
|
};
|
|
};
|
|
};
|
|
mcp = {
|
|
github = {
|
|
type = "local";
|
|
command = [
|
|
githubMcpServer
|
|
"stdio"
|
|
];
|
|
environment = {
|
|
GITHUB_PERSONAL_ACCESS_TOKEN = "{file:${githubToken}}";
|
|
};
|
|
};
|
|
};
|
|
agent = {
|
|
build.tools."github_*" = false;
|
|
plan.tools."github_*" = false;
|
|
};
|
|
#plugin = ["@plannotator/opencode@latest"];
|
|
};
|
|
|
|
"opencode/themes/ayu-mirage.json".source = ./themes/ayu-mirage.json;
|
|
"opencode/agent/librarian.md".source = ./agent/librarian.md;
|
|
"opencode/agent/adversary.md".source = ./agent/adversary.md;
|
|
"opencode/agent/archivist.md".source = ./agent/archivist.md;
|
|
"opencode/command/cleanup.md".source = ./command/cleanup.md;
|
|
"opencode/tool/search-history.ts".source = ./tool/search-history.ts;
|
|
"opencode/skill/session-search/SKILL.md".source = ./skill/session-search/SKILL.md;
|
|
};
|
|
}
|