home-manager/agents: Add Antigravity CLI support
Share agent instructions with Antigravity and enable it on tower, castle and slop-cannon. Configure Paseo to reuse the agent user’s SSH sign-in.
This commit is contained in:
1 parent
b56ce8ff5d
commit
4220964ef2
7 files changed
+48
-21
No files matched your search
@@ -7,21 +7,25 @@ let
|
||||
agentPkgs = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
slopGuide = "${pkgs.slop-broker}/share/slop-broker/slop-tools.md";
|
||||
|
||||
# Claude takes a rule file each; Codex takes one `AGENTS.md`
|
||||
# Claude takes individual rule files. Codex and Antigravity share one `AGENTS.md`.
|
||||
rules = optionalAttrs cfg.slop.enable { slop = slopGuide; }
|
||||
// mapAttrs (name: text: pkgs.writeText "${name}.md" text) cfg.rules;
|
||||
codexContext = pkgs.concatText "AGENTS.md" (attrValues rules);
|
||||
agentContext = pkgs.concatText "AGENTS.md" (attrValues rules);
|
||||
in
|
||||
{
|
||||
options.my.agents = {
|
||||
enable = mkBoolOpt' false "Whether to install and configure coding agents (Claude Code, Codex).";
|
||||
antigravity.enable = mkBoolOpt' false "Whether to also install and configure Antigravity CLI.";
|
||||
slop.enable = mkBoolOpt' false "Whether agents use the `slop` client for privileged operations.";
|
||||
rules = mkOpt' (types.attrsOf types.lines) { }
|
||||
"Instructions for every agent, by name: a Claude rule each, and appended to Codex's `AGENTS.md`.";
|
||||
"Named instructions for every agent, installed as individual Claude rules and combined into an `AGENTS.md` for Codex and Antigravity.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = optional cfg.slop.enable pkgs.slop-broker;
|
||||
home.file = mkIf (cfg.antigravity.enable && rules != { }) {
|
||||
".gemini/AGENTS.md".source = agentContext;
|
||||
};
|
||||
|
||||
programs = {
|
||||
# TODO: Remove mutableSettings guard when Home Manager 26.11 releases; 26.05 lacks it.
|
||||
@@ -46,7 +50,7 @@ in
|
||||
} // optionalAttrs (options.programs.codex ? mutableSettings) {
|
||||
mutableSettings = true;
|
||||
} // optionalAttrs (rules != { }) {
|
||||
context = "${codexContext}";
|
||||
context = "${agentContext}";
|
||||
};
|
||||
|
||||
claude-code = {
|
||||
@@ -63,6 +67,8 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
} // optionalAttrs cfg.antigravity.enable {
|
||||
antigravity-cli.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user