delete opencode custom configs

This commit is contained in:
Rasyidan Akbar F. 2025-12-09 15:56:54 +07:00
commit 05b9b459c1
4 changed files with 6 additions and 121 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, customPkgs, ... }: {
imports = [
./programs/fastfetch
./programs/helix.nix
@ -9,7 +9,6 @@
./devtools/languages.nix
./devtools/default.nix
./devtools/try.nix
./devtools/opencode.nix
./secrets.nix
];
@ -23,7 +22,7 @@
programs.git.enable = true;
home.packages = with pkgs; [ docker docker-compose ];
home.packages = with pkgs; [ docker docker-compose customPkgs.opencode ];
rsydn.aiTools = {
enable = lib.mkDefault true;
@ -35,13 +34,6 @@
path = "~/src/tries";
};
rsydn.opencode = {
enable = lib.mkDefault true;
theme = "catppuccin";
model = "anthropic/claude-sonnet-4-5";
smallModel = "anthropic/claude-haiku-3-5";
};
rsydn.devTools = {
enable = lib.mkDefault true;
packages = with pkgs; [

View file

@ -115,8 +115,6 @@ in {
defaultPackage = crushDefault;
};
# Note: OpenCode is now managed by its own module at ./opencode.nix
claude = toolOption {
name = "Claude Code";
description = "Anthropic Claude Code CLI packaged in nixpkgs.";

View file

@ -1,107 +0,0 @@
{ config, lib, pkgs, customPkgs, ... }:
let
inherit (lib) mkEnableOption mkOption types mkIf;
cfg = config.rsydn.opencode;
# Build the config JSON, filtering out null/empty values
opencodeConfig = lib.filterAttrs (_: v: v != null && v != { }) {
"$schema" = "https://opencode.ai/config.json";
theme = cfg.theme;
model = cfg.model;
small_model = cfg.smallModel;
autoupdate = false; # Nix manages updates
mcp = if cfg.mcpServers != { } then cfg.mcpServers else null;
keybinds = if cfg.keybinds != { } then cfg.keybinds else null;
};
in {
options.rsydn.opencode = {
enable = mkEnableOption "OpenCode CLI with managed configuration";
package = mkOption {
type = types.nullOr types.package;
default = customPkgs.opencode;
description = ''
OpenCode package to use. Defaults to the custom-built package
from packages/opencode.nix via customPkgs.
'';
};
theme = mkOption {
type = types.str;
default = "catppuccin";
description = "UI theme for OpenCode TUI";
};
model = mkOption {
type = types.str;
default = "anthropic/claude-sonnet-4-5";
description = "Primary LLM model identifier";
};
smallModel = mkOption {
type = types.str;
default = "anthropic/claude-haiku-3-5";
description = "Lightweight model for tasks like title generation";
};
mcpServers = mkOption {
type = types.attrs;
default = { };
example = {
nixos = {
type = "stdio";
command = "uvx";
args = [ "mcp-nixos" ];
};
};
description = "MCP server configurations";
};
keybinds = mkOption {
type = types.attrs;
default = { };
description = "Custom keybinding overrides";
};
# Future extension points (joelhooks-style)
agents = mkOption {
type = types.attrsOf types.path;
default = { };
description = ''
Custom agent markdown files.
Keys become filenames under ~/.config/opencode/agent/
'';
};
commands = mkOption {
type = types.attrsOf types.path;
default = { };
description = ''
Custom command markdown files.
Keys become filenames under ~/.config/opencode/command/
'';
};
extraConfig = mkOption {
type = types.attrs;
default = { };
description = "Additional config options to merge into opencode.json";
};
};
config = mkIf cfg.enable {
home.packages = lib.optional (cfg.package != null) cfg.package;
xdg.configFile = {
# Global config file
"opencode/opencode.json".text =
builtins.toJSON (opencodeConfig // cfg.extraConfig);
} // lib.mapAttrs' (name: path:
# Agent markdown files
lib.nameValuePair "opencode/agent/${name}.md" { source = path; })
cfg.agents // lib.mapAttrs' (name: path:
# Command markdown files
lib.nameValuePair "opencode/command/${name}.md" { source = path; })
cfg.commands;
};
}