refactor/remove-pi-agent-cleanup #14
@@ -51,6 +51,44 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
externalSkills = mkOption {
|
||||||
|
type = types.listOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
src = mkOption {
|
||||||
|
type = types.anything;
|
||||||
|
description = "Flake input pointing to a skills repository root.";
|
||||||
|
};
|
||||||
|
skillsDir = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "skills";
|
||||||
|
description = ''
|
||||||
|
Subdirectory inside src that contains skill folders.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
selectSkills = mkOption {
|
||||||
|
type = types.nullOr (types.listOf types.str);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
List of skill names to cherry-pick from this source.
|
||||||
|
null means include every skill found in skillsDir.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
External skill sources passed to mkOpencodeSkills.
|
||||||
|
Each entry maps directly to an element of the externalSkills
|
||||||
|
list accepted by the AGENTS flake's lib.mkOpencodeSkills.
|
||||||
|
'';
|
||||||
|
example = literalExpression ''
|
||||||
|
[
|
||||||
|
{ src = inputs.skills-anthropic; selectSkills = [ "claude-api" ]; }
|
||||||
|
{ src = inputs.basecamp; }
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
freeformType = types.attrsOf types.anything;
|
freeformType = types.attrsOf types.anything;
|
||||||
@@ -222,11 +260,18 @@ in {
|
|||||||
# ── Agents — pi-subagents .md files ────────────────────────────
|
# ── Agents — pi-subagents .md files ────────────────────────────
|
||||||
agentFiles
|
agentFiles
|
||||||
|
|
||||||
# ── Skills symlinked from AGENTS repo ──────────────────────────
|
# ── Skills symlinked from AGENTS repo + external skills ────────
|
||||||
(mkIf (cfg.agentsInput != null) {
|
(mkIf (cfg.agentsInput != null) {
|
||||||
".pi/agent/skills".source = cfg.agentsInput.lib.mkOpencodeSkills {
|
".pi/agent/skills".source = cfg.agentsInput.lib.mkOpencodeSkills {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
customSkills = "${cfg.agentsInput}/skills";
|
customSkills = "${cfg.agentsInput}/skills";
|
||||||
|
externalSkills =
|
||||||
|
map (
|
||||||
|
entry:
|
||||||
|
{inherit (entry) src skillsDir;}
|
||||||
|
// optionalAttrs (entry.selectSkills != null) {inherit (entry) selectSkills;}
|
||||||
|
)
|
||||||
|
cfg.externalSkills;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user