mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
opencode: support directory-based configuration for commands, agents, and themes
The `commands`, `agents`, and `themes` options now accept either an attribute set (existing behavior) or a path to a directory containing multiple files. When a directory path is provided, it is symlinked to the appropriate `$XDG_CONFIG_HOME/opencode/` subdirectory. This change aligns with the existing `skills` option implementation and provides a more convenient way to manage multiple configuration files without needing to define each one individually in Nix.
This commit is contained in:
committed by
Austin Horstman
parent
2be878259a
commit
081234b704
15
tests/modules/programs/opencode/agents-bulk-directory.nix
Normal file
15
tests/modules/programs/opencode/agents-bulk-directory.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
agents = ./agents-bulk;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/agent/code-reviewer.md
|
||||
assertFileExists home-files/.config/opencode/agent/documentation.md
|
||||
assertFileContent home-files/.config/opencode/agent/code-reviewer.md \
|
||||
${./agents-bulk/code-reviewer.md}
|
||||
assertFileContent home-files/.config/opencode/agent/documentation.md \
|
||||
${./agents-bulk/documentation.md}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user