Watch
0
0
Fork
You've already forked hyperhive
0

agent: pull in and allow claude-code only for the claude runtime

This commit is contained in:
atlas 2026-11-04 20:52:49 +01:00
commit 1ce5996c49

View file

@ -83,6 +83,9 @@ let
};
};
hasClaude = machine: lib.any (p: (p.name or "") == "claude") machine.environment.systemPackages;
allowsClaudeCode = machine: machine.nixpkgs.config.allowUnfreePredicate { pname = "claude-code"; };
subagent = machine: machine.systemd.services.hive-subagent-daemon;
harness = machine: machine.systemd.services.hive-agent;
runtimeVars = [
@ -234,6 +237,21 @@ let
&& !(lib.hasInfix "rm -f \"$earlier\"" s)
&& !(lib.hasInfix "mv -f \"$staged\" \"$earlier\"" s);
}
{
name = "an ACP agent has no claude on PATH and no unfree allowance for claude-code";
ok = !(hasClaude acp) && !(allowsClaudeCode acp) && !(allowsClaudeCode opencode);
}
{
# Presence control for the case above: the same lookups find both on a
# claude agent, and the allowance is for claude-code alone.
name = "a claude agent has claude on PATH and an unfree allowance for claude-code only";
ok =
hasClaude claude
&& hasClaude claudeApiKey
&& allowsClaudeCode claude
&& allowsClaudeCode claudeApiKey
&& !(claude.nixpkgs.config.allowUnfreePredicate { pname = "other-unfree"; });
}
];
in
runGroup "agent-runtime" cases