mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
opencode: align tools directory with upstream documentation
This commit is contained in:
committed by
Austin Horstman
parent
26c9d5dca1
commit
287f84846c
@@ -365,11 +365,11 @@ in
|
||||
|
||||
If an attribute set is used, the attribute name becomes the tool filename,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/tool/<name>.ts`)
|
||||
- A path to a file (creates `opencode/tool/<name>.ts` or `opencode/tool/<name>.js`)
|
||||
- Inline content as a string (creates `opencode/tools/<name>.ts`)
|
||||
- A path to a file (creates `opencode/tools/<name>.ts` or `opencode/tools/<name>.js`)
|
||||
|
||||
If a path is used, it is expected to contain tool files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/tool/`.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/tools/`.
|
||||
|
||||
See <https://opencode.ai/docs/tools/> for the documentation.
|
||||
'';
|
||||
@@ -494,7 +494,7 @@ in
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"opencode/tool" = mkIf (lib.isPath cfg.tools) {
|
||||
"opencode/tools" = mkIf (lib.isPath cfg.tools) {
|
||||
source = cfg.tools;
|
||||
recursive = true;
|
||||
};
|
||||
@@ -528,7 +528,7 @@ in
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.tools) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/tool/${name}.ts" (
|
||||
lib.nameValuePair "opencode/tools/${name}.ts" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.tools
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
${./test-agent.md}
|
||||
|
||||
# Tools
|
||||
assertFileExists home-files/.config/opencode/tool/inline-tool.ts
|
||||
assertFileExists home-files/.config/opencode/tool/path-tool.ts
|
||||
assertFileExists home-files/.config/opencode/tools/inline-tool.ts
|
||||
assertFileExists home-files/.config/opencode/tools/path-tool.ts
|
||||
|
||||
assertFileContent home-files/.config/opencode/tool/path-tool.ts \
|
||||
assertFileContent home-files/.config/opencode/tools/path-tool.ts \
|
||||
${./test-tool.ts}
|
||||
|
||||
# Skills
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/tool/database-query.ts
|
||||
assertFileExists home-files/.config/opencode/tool/api-client.ts
|
||||
assertFileContent home-files/.config/opencode/tool/database-query.ts \
|
||||
assertFileExists home-files/.config/opencode/tools/database-query.ts
|
||||
assertFileExists home-files/.config/opencode/tools/api-client.ts
|
||||
assertFileContent home-files/.config/opencode/tools/database-query.ts \
|
||||
${./tools-bulk/database-query.ts}
|
||||
assertFileContent home-files/.config/opencode/tool/api-client.ts \
|
||||
assertFileContent home-files/.config/opencode/tools/api-client.ts \
|
||||
${./tools-bulk/api-client.ts}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/tool/database-query.ts
|
||||
assertFileExists home-files/.config/opencode/tool/api-client.ts
|
||||
assertFileContent home-files/.config/opencode/tool/database-query.ts \
|
||||
assertFileExists home-files/.config/opencode/tools/database-query.ts
|
||||
assertFileExists home-files/.config/opencode/tools/api-client.ts
|
||||
assertFileContent home-files/.config/opencode/tools/database-query.ts \
|
||||
${./database-query-tool.ts}
|
||||
assertFileContent home-files/.config/opencode/tool/api-client.ts \
|
||||
assertFileContent home-files/.config/opencode/tools/api-client.ts \
|
||||
${./api-client-tool.ts}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/tool/test-tool.ts
|
||||
assertFileContent home-files/.config/opencode/tool/test-tool.ts \
|
||||
assertFileExists home-files/.config/opencode/tools/test-tool.ts
|
||||
assertFileContent home-files/.config/opencode/tools/test-tool.ts \
|
||||
${./test-tool.ts}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user