dotfiles/modules/home/programs/opencode/default.nix
alejandro-angulo 3a0b951b3c
Some checks failed
Build NixOS Configurations / build (carbon) (push) Failing after 46s
Build NixOS Configurations / build (framework) (push) Successful in 2m38s
Build NixOS Configurations / build (git) (push) Successful in 1m26s
Build NixOS Configurations / build (gospel) (push) Failing after 35s
Build NixOS Configurations / build (node) (push) Failing after 33s
Fix evaluation warnings
2026-04-14 18:33:14 -07:00

47 lines
863 B
Nix

{
config,
lib,
namespace,
pkgs,
...
}:
let
cfg = config.${namespace}.programs.opencode;
context7 = pkgs.writeShellApplication {
name = "context7-mcp";
runtimeInputs = [ pkgs.nodejs_24 ];
text = ''
npx -y @upstash/context7-mcp
'';
};
in
{
options.${namespace}.programs.opencode = {
enable = lib.mkEnableOption "opencode";
};
config = lib.mkIf cfg.enable {
programs.opencode = {
enable = true;
tui = {
theme = "catppuccin";
keybinds = {
app_exit = "ctrl+d,<leader>q";
session_interrupt = "ctrl+c";
};
};
settings = {
mcp = {
context7 = {
type = "local";
command = [
"${context7}/bin/context7-mcp"
];
enabled = true;
};
};
};
};
};
}