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

@ -41,6 +41,10 @@ let
queue option. Remove the setting.
'';
# Only a claude-runtime agent runs the binary. ACP subagents run on the
# parent agent's runtime, so they need no claude either.
runsClaude = config.services.hyperhive.agent.runtime == "claude";
# `claude` on PATH. A hive that pins a claude-code
# (`services.hyperhive.deploy.hive-controller.claudeCodePackage`) hands its
# store path over at container start as `HYPERHIVE_CLAUDE_CODE_PATH`, and
@ -237,7 +241,10 @@ in
# evaluates its own `nixpkgs` instance, so the operator's host-level
# `nixpkgs.config.allowUnfreePredicate` does not propagate into here —
# we have to allow it inside the container's config as well.
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ];
# Only an agent that runs claude needs it: `runtime = "acp"` never
# references the package, so it is neither built nor allowed there.
nixpkgs.config.allowUnfreePredicate =
pkg: runsClaude && builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ];
# Core tooling every agent gets. Per-bin split packages (see
# nix/packages/default.nix + ./packages.nix) rather than the full
@ -256,9 +263,7 @@ in
environment.systemPackages = [
config.services.hyperhive.agent.packages.hive-metric
]
++ [
claude
]
++ lib.optional runsClaude claude
++ (with pkgs; [
bashInteractive
coreutils-full