refactor: move pi's AGENTS.md concat into the agent-skills module

All four tools' context wiring lives there now; this file just installs
the package.
This commit is contained in:
Miguel Palhas
2026-08-19 15:14:43 +01:00
parent 231b6bdb28
commit 5ba12d3684
+5 -25
View File
@@ -1,32 +1,12 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{ pkgs, ... }:
let
pi = pkgs.callPackage ../../../pkgs/pi/package.nix { };
skills = inputs.agent-skills;
# pi has no `@file` imports in context files, so fragments get concatenated
# into one AGENTS.md. Skills need no wiring: pi reads ~/.agents/skills, which
# the agent-skills module already links.
agentsMd = pkgs.writeText "pi-AGENTS.md" (
lib.concatMapStringsSep "\n" builtins.readFile [
"${skills}/claude-md/machines/${config.programs.agentSkills.machine}.md"
"${skills}/claude-md/operating.md"
"${skills}/claude-md/writing.md"
"${skills}/claude-md/code-comments.md"
"${skills}/claude-md/RTK.md"
]
);
in
{
home.packages = [ pi ];
# ~/.pi/agent/AGENTS.md comes from the agent-skills home-manager module
# (pi has no @file imports, so the module concatenates the shared fragments).
# Pi reads skills straight from ~/.agents/skills, which the module links.
# Settings stay unmanaged: pi writes ~/.pi/agent/settings.json itself from
# /settings, /trust and `pi config`.
home.file.".pi/agent/AGENTS.md".source = agentsMd;
home.packages = [ pi ];
}