added some stuff

This commit is contained in:
fwastring 2026-04-06 20:37:39 +02:00
parent 39a1b68c8f
commit c03fa07723
7 changed files with 284 additions and 111 deletions

View file

@ -6,7 +6,22 @@
myhostname,
...
}:
let
inherit (lib) mkOption types;
in
{
options.opencode.mcpEnabled = mkOption {
type = types.attrsOf types.bool;
default = {
az = false;
k8s = true;
github = true;
jira = true;
google = false;
};
description = "Per-host MCP enablement flags for OpenCode servers.";
};
imports = [
../moduler/tmux.nix
../moduler/fish.nix
@ -23,97 +38,132 @@
../moduler/programs/k9s
];
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.opencode = {
enable = true;
enableMcpIntegration = false;
settings = {
"$schema" = "https://opencode.ai/config.json";
theme = lib.mkForce "catppuccin";
plugin = [ "@ex-machina/opencode-anthropic-auth" ];
mcp = {
az = {
type = "local";
command = [
"docker"
"run"
"-i"
"--rm"
"--env-file"
"/home/fw/.azure/credentials"
"mcr.microsoft.com/azure-sdk/azure-mcp:latest"
];
};
k8s = {
type = "local";
command = [
"docker"
"run"
"--rm"
"-i"
"--user"
"1000:100"
"-v"
"/home/fw/.kube:/kube:ro"
"ghcr.io/containers/kubernetes-mcp-server:latest"
"--kubeconfig"
"/kube/config"
];
};
github = {
type = "local";
command = [
"docker"
"run"
"-i"
"--rm"
"-e"
"GITHUB_PERSONAL_ACCESS_TOKEN"
"ghcr.io/github/github-mcp-server"
];
};
jira = {
type = "local";
command = [
"docker"
"run"
"-i"
"--rm"
"--env-file"
"/home/fw/.config/opencode/.env.local"
"ghcr.io/sooperset/mcp-atlassian:latest"
];
config = {
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.opencode = {
enable = true;
enableMcpIntegration = false;
settings = {
"$schema" = "https://opencode.ai/config.json";
theme = lib.mkForce "catppuccin";
plugin = [ "@ex-machina/opencode-anthropic-auth" ];
mcp = {
az = {
type = "local";
enabled = config.opencode.mcpEnabled.az or false;
command = [
"docker"
"run"
"-i"
"--rm"
"--env-file"
"/home/fw/.azure/credentials"
"mcr.microsoft.com/azure-sdk/azure-mcp:latest"
];
};
k8s = {
type = "local";
enabled = config.opencode.mcpEnabled.k8s or false;
command = [
"docker"
"run"
"--rm"
"-i"
"--user"
"1000:100"
"-v"
"/home/fw/.kube:/kube:ro"
"ghcr.io/containers/kubernetes-mcp-server:latest"
"--kubeconfig"
"/kube/config"
];
};
github = {
type = "local";
enabled = config.opencode.mcpEnabled.github or false;
command = [
"docker"
"run"
"-i"
"--rm"
"-e"
"GITHUB_PERSONAL_ACCESS_TOKEN"
"ghcr.io/github/github-mcp-server"
];
};
jira = {
type = "local";
enabled = config.opencode.mcpEnabled.jira or false;
command = [
"docker"
"run"
"-i"
"--rm"
"--env-file"
"/home/fw/.config/opencode/.env.local"
"ghcr.io/sooperset/mcp-atlassian:latest"
];
};
google = {
type = "local";
command = [
"docker"
"run"
"-i"
"--rm"
"--network"
"host"
"--user"
"1000:100"
"-v"
"/home/fw/.local/share/google-workspace-mcp:/home/app/.google_workspace_mcp"
"-e"
"GOOGLE_OAUTH_CLIENT_ID"
"-e"
"GOOGLE_OAUTH_CLIENT_SECRET"
"-e"
"USER_GOOGLE_EMAIL"
"-e"
"OAUTHLIB_INSECURE_TRANSPORT=1"
"--entrypoint"
"/app/.venv/bin/python"
"ghcr.io/taylorwilsdon/google_workspace_mcp:latest"
"/app/main.py"
"--single-user"
];
enabled = config.opencode.mcpEnabled.google or false;
};
};
};
};
};
home.activation.opencodeAtlassianEnv = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "$HOME/.config/opencode"
if [ -r /run/secrets/opencode_atlassian_env ]; then
ln -sf /run/secrets/opencode_atlassian_env "$HOME/.config/opencode/.env.local"
fi
'';
home.activation.opencodeAtlassianEnv = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "$HOME/.config/opencode"
if [ -r /run/secrets/opencode_atlassian_env ]; then
ln -sf /run/secrets/opencode_atlassian_env "$HOME/.config/opencode/.env.local"
fi
'';
programs.alacritty = {
enable = true;
# theme = "catppuccin_${theme}";
theme = "catppuccin_mocha";
settings = {
font = {
normal = {
family = lib.mkForce "FiraCode Nerd Font Mono";
programs.alacritty = {
enable = true;
# theme = "catppuccin_${theme}";
theme = "catppuccin_mocha";
settings = {
font = {
normal = {
family = lib.mkForce "FiraCode Nerd Font Mono";
};
size = lib.mkForce 16;
};
size = lib.mkForce 16;
};
};
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "25.05";
systemd.user.startServices = "sd-switch";
};
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "25.05";
systemd.user.startServices = "sd-switch";
}