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.
24 lines
597 B
Nix
24 lines
597 B
Nix
{
|
|
imports = [ ./opencode-stubs.nix ];
|
|
|
|
programs.opencode = {
|
|
enable = true;
|
|
cli.theme.name = "system";
|
|
validateFiles.cli = true;
|
|
};
|
|
|
|
test.asserts.warnings.expected = [
|
|
''
|
|
programs.opencode.cli requires OpenCode 2 or later, but the configured
|
|
package is version 1.18.31.
|
|
|
|
Use programs.opencode.tui for OpenCode 1, or update
|
|
programs.opencode.package.
|
|
''
|
|
];
|
|
|
|
test.asserts.assertions.expected = [
|
|
"`programs.opencode.validateFiles.cli` requires `programs.opencode.package` to provide `passthru.jsonschema.cli` (OpenCode 2 or later)"
|
|
];
|
|
}
|