The skills option was creating files under ~/.config/opencode/skill/ (singular) but OpenCode documentation only mentions ~/.config/opencode/skills/ (plural). Both work, but using an undocumented directory can be confusing. Fixes: https://github.com/nix-community/home-manager/issues/8907
24 lines
605 B
Nix
24 lines
605 B
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
src = pkgs.writeTextDir "skills/external-skill/SKILL.md" ''
|
|
# Mock Skill
|
|
This content simulates a skill living inside a package source.
|
|
'';
|
|
in
|
|
{
|
|
programs.opencode = {
|
|
enable = true;
|
|
skills = {
|
|
# We reference the specific subfolder inside the store path
|
|
internal-skill = "${src}/skills/external-skill";
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/opencode/skills/internal-skill/SKILL.md
|
|
|
|
assertFileContent home-files/.config/opencode/skills/internal-skill/SKILL.md \
|
|
"${src}/skills/external-skill/SKILL.md"
|
|
'';
|
|
}
|