codex: support store-path skill sources

Handle per-skill values that come through as store-path strings, such as fetcher outputs with subdirectories appended. This restores the previously working pattern for packaged skill directories and adds a regression test for both directory and file sources.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2026-03-24 10:19:38 -05:00
parent 5068d0b03e
commit b8cb89f2c4
3 changed files with 41 additions and 2 deletions

View file

@ -9,5 +9,6 @@
codex-skills-inline-null-package = ./skills-inline-null-package.nix;
codex-skills-inline-legacy-path = ./skills-inline-legacy-path.nix;
codex-skills-dir = ./skills-dir.nix;
codex-skills-store-path = ./skills-store-path.nix;
codex-skills-path-not-directory = ./skills-path-not-directory.nix;
}

View file

@ -0,0 +1,34 @@
{ pkgs, ... }:
let
src = pkgs.writeTextDir "skills/external-skill/SKILL.md" ''
---
name: external-skill
description: Store path skill fixture.
---
# External Skill
This content simulates a skill living inside a package source.
'';
in
{
programs.codex = {
enable = true;
skills = {
dir-skill = "${src}/skills/external-skill";
file-skill = "${src}/skills/external-skill/SKILL.md";
};
};
nmt.script = ''
assertLinkExists home-files/.agents/skills/dir-skill
assertFileExists home-files/.agents/skills/dir-skill/SKILL.md
assertFileContent home-files/.agents/skills/dir-skill/SKILL.md \
"${src}/skills/external-skill/SKILL.md"
assertLinkExists home-files/.agents/skills/file-skill
assertFileExists home-files/.agents/skills/file-skill/SKILL.md
assertFileContent home-files/.agents/skills/file-skill/SKILL.md \
"${src}/skills/external-skill/SKILL.md"
'';
}