mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +00:00
github-copilot-cli: avoid IFD for path inputs
Validate derived agent and skill directories during builds and normalize derived skill files without evaluation-time filesystem reads.
This commit is contained in:
@@ -6,6 +6,6 @@
|
||||
github-copilot-cli-mcp-integration = ./mcp-integration.nix;
|
||||
github-copilot-cli-path-not-directory = ./path-not-directory.nix;
|
||||
github-copilot-cli-store-path-dir = ./store-path-dir.nix;
|
||||
github-copilot-cli-store-path-not-directory = ./store-path-not-directory.nix;
|
||||
github-copilot-cli-store-path-skills = ./store-path-skills.nix;
|
||||
github-copilot-cli-xdg-config-dir = ./xdg-config-dir.nix;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
{ pkgs, ... }:
|
||||
{ realPkgs, ... }:
|
||||
let
|
||||
src = pkgs.writeTextDir "agents/code-reviewer.agent.md" ''
|
||||
---
|
||||
description: Review changes from a store-path directory fixture.
|
||||
tools: ["*"]
|
||||
---
|
||||
|
||||
Focus on correctness and missing coverage.
|
||||
src = realPkgs.runCommand "github-copilot-cli-ifd-agents-directory" { } ''
|
||||
mkdir -p "$out/agents"
|
||||
echo '# Code Reviewer' > "$out/agents/code-reviewer.agent.md"
|
||||
'';
|
||||
|
||||
skillsSrc = pkgs.writeTextDir "skills/external-skill/SKILL.md" ''
|
||||
---
|
||||
name: external-skill
|
||||
description: Store-path directory fixture.
|
||||
---
|
||||
|
||||
Exercise top-level store-path directory handling.
|
||||
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
|
||||
{
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
agentFile = pkgs.writeText "code-reviewer.agent.md" ''
|
||||
---
|
||||
description: Invalid top-level agent file fixture.
|
||||
tools: ["*"]
|
||||
---
|
||||
'';
|
||||
|
||||
skillFile = pkgs.writeText "SKILL.md" ''
|
||||
---
|
||||
name: invalid-top-level-skill
|
||||
description: Invalid top-level skill file fixture.
|
||||
---
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.github-copilot-cli = {
|
||||
enable = true;
|
||||
agents = "${agentFile}";
|
||||
skills = "${skillFile}";
|
||||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"`programs.github-copilot-cli.agents` must be a directory when set to a path"
|
||||
"`programs.github-copilot-cli.skills` must be a directory when set to a path"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ realPkgs, ... }:
|
||||
|
||||
let
|
||||
src = realPkgs.runCommand "github-copilot-cli-ifd-skill-source" { } ''
|
||||
mkdir -p "$out/skills/external-skill"
|
||||
echo '# External Skill' > "$out/skills/external-skill/SKILL.md"
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.github-copilot-cli = {
|
||||
enable = true;
|
||||
skills = {
|
||||
directory = "${src}/skills/external-skill";
|
||||
file = "${src}/skills/external-skill/SKILL.md";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent home-files/.copilot/skills/directory/SKILL.md \
|
||||
"${src}/skills/external-skill/SKILL.md"
|
||||
assertFileContent home-files/.copilot/skills/file/SKILL.md \
|
||||
"${src}/skills/external-skill/SKILL.md"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user