Watch
0
0
Fork
You've already forked hyperhive
0

the rendered meta flake pins hyperhive by forge URL and follows its nixpkgs

This commit is contained in:
atlas 2026-10-18 19:02:09 +02:00
commit bb13909d8e
8 changed files with 135 additions and 153 deletions

View file

@ -97,7 +97,7 @@ let
serveConfigJson = builtins.toJSON {
hyperhive_flake = cfg.hyperhiveFlake;
hyperhive_docs_flake = cfg.hyperhiveDocs;
nixpkgs_flake = cfg.nixpkgsFlake;
hyperhive_rev = cfg.hyperhiveRev;
# The `claude-code` every agent runs, or null for "each agent keeps
# the one out of its own nixpkgs". `builtins.toJSON` serialises a
# derivation as its out path (and null as null), so the package goes

View file

@ -70,12 +70,24 @@
type = lib.types.str;
defaultText = lib.literalMD "the hyperhive flake's own filtered source store path";
description = ''
URL of the hyperhive flake (no fragment). Inlined into each
per-agent `flake.nix` at `inputs.hyperhive.url`. The per-agent
flake then pulls `hyperhive.nixosConfigurations.agent-base` to
build the container. Wired by `nixosModules.default` to this
flake's own filtered source — only override if you want agents
tracking a different ref.
Store path of the hyperhive flake source (no fragment). hive-c0re
reads it to tell which revision is running, and the swarm builder
builds on it. The meta flake does not use it: that pins
`hyperhive` by forge URL and `hyperhiveRev`. Wired by
`nixosModules.default` to this flake's own filtered source.
'';
};
hyperhiveRev = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
defaultText = lib.literalMD "the hyperhive flake's own `self.rev`";
description = ''
Git rev of the hyperhive checkout this host runs. hive-c0re pins
the generated meta flake's `hyperhive` input to
`git+<forge>/hyperhive/hyperhive.git?rev=<rev>`, and `nixpkgs`
follows that input. Wired by `nixosModules.default` from
`self.rev`, which a dirty tree does not have; with `null`,
hive-c0re refuses to render the meta flake.
'';
};
hyperhiveDocs = lib.mkOption {
@ -105,20 +117,12 @@
default = "path:${pkgs.path}";
defaultText = lib.literalMD "`\"path:\${pkgs.path}\"`";
description = ''
Store-path URL for the `nixpkgs` input in the generated meta
flake. The meta flake declares this as a top-level input and
wires `inputs.hyperhive.inputs.nixpkgs.follows = "nixpkgs"` so
every agent container evaluates with this exact nixpkgs.
Store-path URL of the nixpkgs the swarm builder's check flake
builds on. The generated meta flake does not use it: its `nixpkgs`
follows `hyperhive/nixpkgs`.
Defaults to `"path:''${pkgs.path}"` — the store path of the
nixpkgs the host NixOS module was evaluated with. When the
operator sets `inputs.hyperhive.inputs.nixpkgs.follows =
"nixpkgs"` in their host flake, `pkgs.path` resolves to the
host's own nixpkgs, so agents transparently track the same
channel as the host.
Override to pin agents to a specific nixpkgs version regardless
of the host's channel.
Defaults to `"path:''${pkgs.path}"`, the nixpkgs the host NixOS
module was evaluated with.
'';
};
preBuildAgentTemplates = lib.mkOption {
@ -340,7 +344,7 @@
description = ''
The `claude-code` build every agent on this hive runs, or `null` (the
default) to leave each agent on the `claude-code` from its own
nixpkgs — i.e. whatever `c0re.nixpkgsFlake` resolves to.
nixpkgs — i.e. the nixpkgs pinned by hyperhive's own `flake.lock`.
This is the one binary the whole hive is built around, and it
moves fast enough that a release channel routinely trails

View file

@ -135,8 +135,8 @@ let
&& lib.elem "swarm-bao-pki.service" c.after;
}
{
# The check builds on the sources a hive on this host would render into
# its meta flake, so a green check means the same base.
# The check builds on the sources this host was deployed with, so a green check means
# the same hyperhive, docs and nixpkgs base.
name = "the builder builds on the hyperhive, docs and nixpkgs this host's hives use";
ok =
env.SWARM_BUILDER_HYPERHIVE_FLAKE == withBuilder.services.hyperhive.c0re.hyperhiveFlake