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.
23 lines
596 B
Nix
23 lines
596 B
Nix
{
|
|
imports = [ ./opencode-v2-stubs.nix ];
|
|
|
|
programs.opencode = {
|
|
enable = true;
|
|
tui.theme = "system";
|
|
};
|
|
|
|
test.asserts.warnings.expected = [
|
|
''
|
|
programs.opencode.tui is ignored by OpenCode 2.
|
|
|
|
OpenCode 2 replaced tui.json with a single global cli.json. Move
|
|
terminal client settings to programs.opencode.cli. When
|
|
programs.opencode.mutableSettings is enabled, OPENCODE_TUI_CONFIG is
|
|
ignored as well.
|
|
|
|
OpenCode 2 only migrates an existing tui.json when cli.json does not
|
|
exist. See: https://opencode.ai/v2/docs/cli/config
|
|
''
|
|
];
|
|
}
|