swarm containers: run the claude-code the hive pins for agents
This commit is contained in:
parent
1302288474
commit
a169947f15
6 changed files with 65 additions and 2 deletions
|
|
@ -99,6 +99,13 @@ let
|
|||
deploy.builder.enable = false;
|
||||
};
|
||||
|
||||
# Same, with the claude-code build the agents run pinned on the hive. Any
|
||||
# package serves: only the path the containers are pointed at is read.
|
||||
swarmServicesPinnedClaude = hiveWithController {
|
||||
deploy.allSwarmServices = true;
|
||||
c0re.claudeCodePackage = pkgs.hello;
|
||||
};
|
||||
|
||||
# Same, with one of those services placed on another host. Every derivation
|
||||
# in that module is `mkDefault` so this stays expressible.
|
||||
swarmServicesBaoElsewhere = hive {
|
||||
|
|
@ -273,6 +280,30 @@ let
|
|||
&& !(swarmServicesBaoElsewhere.containers ? swarm-claude-login)
|
||||
&& swarmServicesBaoElsewhere.services.hyperhive.deploy.nats.enable;
|
||||
}
|
||||
{
|
||||
# The CLI is the one the agents run, not the container's own nixpkgs'.
|
||||
# Unpinned is the control: it falls back to the container's own `claude-code`.
|
||||
name = "the claude login minter and the review classifier run the claude-code the hive pins";
|
||||
ok =
|
||||
let
|
||||
claudeOf =
|
||||
host: container: unit: var:
|
||||
host.containers.${container}.config.systemd.services.${unit}.environment.${var};
|
||||
pinned = "${pkgs.hello}/bin/claude";
|
||||
in
|
||||
claudeOf swarmServicesPinnedClaude "swarm-claude-login" "swarm-claude-login"
|
||||
"SWARM_CLAUDE_LOGIN_CLAUDE" == pinned
|
||||
&&
|
||||
claudeOf swarmServicesPinnedClaude "swarm-review-classifier" "swarm-review-classifier"
|
||||
"SWARM_REVIEW_CLASSIFIER_CLAUDE" == pinned
|
||||
&& lib.hasInfix "claude-code" (
|
||||
claudeOf swarmServicesHere "swarm-claude-login" "swarm-claude-login" "SWARM_CLAUDE_LOGIN_CLAUDE"
|
||||
)
|
||||
&& lib.hasInfix "claude-code" (
|
||||
claudeOf swarmServicesHere "swarm-review-classifier" "swarm-review-classifier"
|
||||
"SWARM_REVIEW_CLASSIFIER_CLAUDE"
|
||||
);
|
||||
}
|
||||
{
|
||||
# The switch fills in for an operator who has not spoken and yields to
|
||||
# one who has — that is what keeps a shared service placeable on a host
|
||||
|
|
|
|||
Loading…
Reference in a new issue