diff --git a/modules/programs/opencode.nix b/modules/programs/opencode.nix index 4cae5b72..62706508 100644 --- a/modules/programs/opencode.nix +++ b/modules/programs/opencode.nix @@ -80,7 +80,7 @@ in } ''; description = '' - Configuration written to {file}`$XDG_CONFIG_HOME/opencode/config.json`. + Configuration written to {file}`$XDG_CONFIG_HOME/opencode/opencode.json`. See for the documentation. Note, `"$schema": "https://opencode.ai/config.json"` is automatically added to the configuration. @@ -336,7 +336,7 @@ in home.packages = mkIf (cfg.package != null) [ cfg.package ]; xdg.configFile = { - "opencode/config.json" = mkIf (cfg.settings != { } || transformedMcpServers != { }) { + "opencode/opencode.json" = mkIf (cfg.settings != { } || transformedMcpServers != { }) { source = let # Merge MCP servers: transformed servers + user settings, with user settings taking precedence @@ -345,7 +345,7 @@ in mergedSettings = cfg.settings // (lib.optionalAttrs (mergedMcpServers != { }) { mcp = mergedMcpServers; }); in - jsonFormat.generate "config.json" ( + jsonFormat.generate "opencode.json" ( { "$schema" = "https://opencode.ai/config.json"; } diff --git a/tests/modules/programs/opencode/empty-settings.nix b/tests/modules/programs/opencode/empty-settings.nix index f42b470a..48eb5e2a 100644 --- a/tests/modules/programs/opencode/empty-settings.nix +++ b/tests/modules/programs/opencode/empty-settings.nix @@ -4,6 +4,6 @@ settings = { }; }; nmt.script = '' - assertPathNotExists home-files/.config/opencode/config.json + assertPathNotExists home-files/.config/opencode/opencode.json ''; } diff --git a/tests/modules/programs/opencode/mcp-integration-with-override.nix b/tests/modules/programs/opencode/mcp-integration-with-override.nix index c66133b8..35dd9980 100644 --- a/tests/modules/programs/opencode/mcp-integration-with-override.nix +++ b/tests/modules/programs/opencode/mcp-integration-with-override.nix @@ -41,8 +41,8 @@ }; nmt.script = '' - assertFileExists home-files/.config/opencode/config.json - assertFileContent home-files/.config/opencode/config.json \ + assertFileExists home-files/.config/opencode/opencode.json + assertFileContent home-files/.config/opencode/opencode.json \ ${./mcp-integration-with-override.json} ''; } diff --git a/tests/modules/programs/opencode/mcp-integration.nix b/tests/modules/programs/opencode/mcp-integration.nix index f3d0f180..7afa6eff 100644 --- a/tests/modules/programs/opencode/mcp-integration.nix +++ b/tests/modules/programs/opencode/mcp-integration.nix @@ -29,8 +29,8 @@ }; nmt.script = '' - assertFileExists home-files/.config/opencode/config.json - assertFileContent home-files/.config/opencode/config.json \ + assertFileExists home-files/.config/opencode/opencode.json + assertFileContent home-files/.config/opencode/opencode.json \ ${./mcp-integration.json} ''; } diff --git a/tests/modules/programs/opencode/config.json b/tests/modules/programs/opencode/opencode.json similarity index 100% rename from tests/modules/programs/opencode/config.json rename to tests/modules/programs/opencode/opencode.json diff --git a/tests/modules/programs/opencode/settings.nix b/tests/modules/programs/opencode/settings.nix index 64e4d60f..2197438a 100644 --- a/tests/modules/programs/opencode/settings.nix +++ b/tests/modules/programs/opencode/settings.nix @@ -9,8 +9,8 @@ }; }; nmt.script = '' - assertFileExists home-files/.config/opencode/config.json - assertFileContent home-files/.config/opencode/config.json \ - ${./config.json} + assertFileExists home-files/.config/opencode/opencode.json + assertFileContent home-files/.config/opencode/opencode.json \ + ${./opencode.json} ''; }