2.home-manager/tests/modules/programs/opencode/skills-store-path.nix
Mirza Arnaut 63ecc7d495 opencode: handle string store paths in skill sources
Add support for store directory paths provided as strings, in addition
to the existing path type check for directories.
Context: certain project will include a `SKILL.md` file, and instead of
managing them via some 3rd party manager or manually, why not include
them from the source itself! I implemented this in my setup, since I
wanted to include the `SKILL.md` file from the
[beads](https://github.com/steveyegge/beads) project.
2026-01-25 15:50:05 -06:00

24 lines
603 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/skill/internal-skill/SKILL.md
assertFileContent home-files/.config/opencode/skill/internal-skill/SKILL.md \
"${src}/skills/external-skill/SKILL.md"
'';
}