Files
nix-config-ryan4yin/home/base/tui/agents/rules.nix
T
ryan4yin | 二花 9d69832ff7 refactor(agents): pin global skills and trim always-loaded context (#427)
* feat(agents): pin global skills as flake inputs
* refactor(agents): trim always-loaded agent context
2026-10-10 12:16:56 +08:00

22 lines
1000 B
Nix

{ config, ... }:
let
# The global rules are edited often, so link them out-of-store: an edit reaches
# the next agent session without a Home Manager switch. Same rationale as
# `home/base/tui/tuios`; the checkout path is hardcoded, like the repo's other
# out-of-store links. The source is not named AGENTS.md, so agents working in
# this checkout do not load it a second time as nested instructions for agents/.
rules = "${config.home.homeDirectory}/nix-config/agents/global-rules.md";
link = config.lib.file.mkOutOfStoreSymlink rules;
in
{
# One canonical rules file, projected into every agent's config location.
home.file = {
".codex/AGENTS.md".source = link; # Codex
".pi/agent/AGENTS.md".source = link; # Pi
".agents/AGENTS.md".source = link; # cross-tool; dsh's `$DSH_AGENTS_HOME` from 0.2.1-alpha.2
".dsh/AGENTS.md".source = link; # dsh's `$DSH_HOME`, its only global scope before that
};
xdg.configFile."opencode/AGENTS.md".source = link; # OpenCode
}