From 05b9b459c16fafa051dc73342053b34cca714f7d Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Tue, 9 Dec 2025 15:56:54 +0700 Subject: [PATCH] delete opencode custom configs --- flake.nix | 6 +- modules/home/base.nix | 12 +--- modules/home/devtools/ai-tools.nix | 2 - modules/home/devtools/opencode.nix | 107 ----------------------------- 4 files changed, 6 insertions(+), 121 deletions(-) delete mode 100644 modules/home/devtools/opencode.nix diff --git a/flake.nix b/flake.nix index fa45aac..4738df7 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,8 @@ pkgs = mkPkgs system; customPkgs = import ./packages { inherit pkgs lib beads; }; in darwin.lib.darwinSystem { - inherit system pkgs; + inherit pkgs; + system = pkgs.stdenv.hostPlatform.system; specialArgs = { inherit inputs overlaysList user; }; modules = sharedDarwinModules ++ extraModules ++ [ home-manager.darwinModules.home-manager @@ -84,7 +85,8 @@ pkgs = mkPkgs system; customPkgs = import ./packages { inherit pkgs lib beads; }; in lib.nixosSystem { - inherit system pkgs; + inherit pkgs; + system = pkgs.stdenv.hostPlatform.system; specialArgs = { inherit inputs overlaysList user; }; modules = sharedNixosModules ++ extraModules ++ [ home-manager.nixosModules.home-manager diff --git a/modules/home/base.nix b/modules/home/base.nix index 4dd6811..e136c42 100644 --- a/modules/home/base.nix +++ b/modules/home/base.nix @@ -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; [ diff --git a/modules/home/devtools/ai-tools.nix b/modules/home/devtools/ai-tools.nix index d191835..4a8cb0d 100644 --- a/modules/home/devtools/ai-tools.nix +++ b/modules/home/devtools/ai-tools.nix @@ -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."; diff --git a/modules/home/devtools/opencode.nix b/modules/home/devtools/opencode.nix deleted file mode 100644 index fd019f2..0000000 --- a/modules/home/devtools/opencode.nix +++ /dev/null @@ -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; - }; -}