mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-31 09:10:11 +00:00
Validate derived agent and skill directories during builds and normalize derived skill files without evaluation-time filesystem reads.
32 lines
1.1 KiB
Nix
32 lines
1.1 KiB
Nix
{ realPkgs, ... }:
|
|
let
|
|
src = realPkgs.runCommand "github-copilot-cli-ifd-agents-directory" { } ''
|
|
mkdir -p "$out/agents"
|
|
echo '# Code Reviewer' > "$out/agents/code-reviewer.agent.md"
|
|
'';
|
|
|
|
skillsSrc = realPkgs.runCommand "github-copilot-cli-ifd-skills-directory" { } ''
|
|
mkdir -p "$out/skills/external-skill"
|
|
echo '# External Skill' > "$out/skills/external-skill/SKILL.md"
|
|
'';
|
|
in
|
|
{
|
|
programs.github-copilot-cli = {
|
|
enable = true;
|
|
agents = "${src}/agents";
|
|
skills = "${skillsSrc}/skills";
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.copilot/agents/code-reviewer.agent.md
|
|
assertLinkExists home-files/.copilot/agents/code-reviewer.agent.md
|
|
assertFileContent home-files/.copilot/agents/code-reviewer.agent.md \
|
|
"${src}/agents/code-reviewer.agent.md"
|
|
|
|
assertFileExists home-files/.copilot/skills/external-skill/SKILL.md
|
|
assertLinkExists home-files/.copilot/skills/external-skill/SKILL.md
|
|
assertFileContent home-files/.copilot/skills/external-skill/SKILL.md \
|
|
"${skillsSrc}/skills/external-skill/SKILL.md"
|
|
'';
|
|
}
|