mirror of
https://github.com/nix-community/home-manager.git
synced 2026-12-06 04:40:17 +00:00
Add programs.opencode.cli for OpenCode 2's global cli.json, while retaining programs.opencode.tui for OpenCode 1. Support mutable CLI configuration through OPENCODE_CLI_CONFIG_CONTENT, leaving cli.json writable by OpenCode. Add validation against the configured package's CLI schema and warn when CLI or TUI settings do not match the package version.
36 lines
840 B
Nix
36 lines
840 B
Nix
{
|
|
imports = [ ./opencode-v2-stubs.nix ];
|
|
|
|
programs.opencode = {
|
|
enable = true;
|
|
settings = {
|
|
model = "anthropic/claude-sonnet-4-5";
|
|
autoshare = false;
|
|
autoupdate = true;
|
|
};
|
|
cli = {
|
|
theme = {
|
|
name = "tokyonight";
|
|
mode = "system";
|
|
};
|
|
scroll.speed = 3;
|
|
tabs.mode = "off";
|
|
keybinds.leader = "alt+b";
|
|
};
|
|
validateFiles = {
|
|
config = true;
|
|
cli = true;
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/opencode/opencode.json
|
|
assertFileContent home-files/.config/opencode/opencode.json \
|
|
${./opencode.json}
|
|
assertFileExists home-files/.config/opencode/cli.json
|
|
assertFileContent home-files/.config/opencode/cli.json \
|
|
${./cli.json}
|
|
assertPathNotExists home-files/.config/opencode/tui.json
|
|
'';
|
|
}
|