mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
opencode: add JSON schema reference to config.json output
- Automatically include "$schema": "https://opencode.ai/config.json" in the generated opencode config.json file - Update documentation to mention the added schema property - Add corresponding "$schema" entry in test config.json file for validation purposes Closes #7506
This commit is contained in:
parent
1df662dde0
commit
64796151f7
2 changed files with 8 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ in
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to {file}`$XDG_CONFIG_HOME/opencode/config.json`.
|
Configuration written to {file}`$XDG_CONFIG_HOME/opencode/config.json`.
|
||||||
See <https://opencode.ai/docs/config/> for the documentation.
|
See <https://opencode.ai/docs/config/> for the documentation.
|
||||||
|
'"$schema": "https://opencode.ai/config.json"' is automatically added to the config.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
rules = lib.mkOption {
|
rules = lib.mkOption {
|
||||||
|
|
@ -79,7 +80,12 @@ in
|
||||||
|
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"opencode/config.json" = mkIf (cfg.settings != { }) {
|
"opencode/config.json" = mkIf (cfg.settings != { }) {
|
||||||
source = jsonFormat.generate "config.json" cfg.settings;
|
source = jsonFormat.generate "config.json" (
|
||||||
|
{
|
||||||
|
"$schema" = "https://opencode.ai/config.json";
|
||||||
|
}
|
||||||
|
// cfg.settings
|
||||||
|
);
|
||||||
};
|
};
|
||||||
"opencode/AGENTS.md" = mkIf (cfg.rules != "") {
|
"opencode/AGENTS.md" = mkIf (cfg.rules != "") {
|
||||||
text = cfg.rules;
|
text = cfg.rules;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"autoshare": false,
|
"autoshare": false,
|
||||||
"autoupdate": true,
|
"autoupdate": true,
|
||||||
"model": "anthropic/claude-sonnet-4-20250514",
|
"model": "anthropic/claude-sonnet-4-20250514",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue