refactor(opencode): generate config.json from the home module

Build opencode's config.json with pkgs.formats.json instead of shipping
a static file, pinning each formatter command to its store-path binary
via lib.getExe. Drops the standalone config/opencode/config.json.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harald Hoyer 2026-05-21 22:06:35 +02:00
parent d0c58a5c9d
commit d10570a0d8
2 changed files with 82 additions and 53 deletions

View file

@ -1,43 +0,0 @@
{
"$schema": "https://opencode.ai/config.json",
"lsp": true,
"formatter": {
"nixfmt": {
"command": ["nixfmt", "$FILE"],
"extensions": [".nix"]
},
"prettier": {
"command": ["prettier", "--write", "$FILE"],
"extensions": [".md", ".yaml", ".yml", ".json", ".css", ".html", ".js", ".ts", ".jsx", ".tsx"]
},
"shfmt": {
"command": ["shfmt", "-w", "$FILE"],
"extensions": [".sh", ".bash"]
},
"ruff": {
"command": ["ruff", "format", "$FILE"],
"extensions": [".py"]
},
"taplo": {
"command": ["taplo", "format", "$FILE"],
"extensions": [".toml"]
},
"stylua": {
"command": ["stylua", "$FILE"],
"extensions": [".lua"]
}
},
"disabled_providers": ["opencode"],
"provider": {
"halo": {
"npm": "@ai-sdk/openai-compatible",
"name": "Halo",
"options": {
"baseURL": "http://halo:8000/v1"
},
"models": {
"coder": { "name": "coder" }
}
}
}
}