From 4f91dfef9946cfcfd19c74bc94080068af095adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 15 May 2026 16:51:18 +0200 Subject: [PATCH] =?UTF-8?q?module:=20thread=20hyperhive=20package=20direct?= =?UTF-8?q?ly=20=E2=80=94=20operators=20don't=20apply=20overlays?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++------ flake.nix | 11 ++++++++++- hive-ag3nt/src/mcp.rs | 11 +++++------ hive-ag3nt/src/web_ui.rs | 6 +----- hive-c0re/src/dashboard.rs | 6 +----- nix/modules/hive-c0re.nix | 5 +++-- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9052bdb..9433dca 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,6 @@ Minimal `flake.nix` for a host that runs hive-c0re: modules = [ hyperhive.nixosModules.hive-c0re ({ ... }: { - nixpkgs.overlays = [ - hyperhive.overlays.default - hyperhive.overlays.claude-unstable - ]; services.hive-c0re = { enable = true; hyperhiveFlake = "${hyperhive}"; @@ -102,5 +98,6 @@ nix flake update --update-input hyperhive sudo nixos-rebuild switch --flake .# ``` -The host config also needs `hyperhive.overlays.default` applied — the -module's default `package = pkgs.hyperhive` requires the overlay. +No overlays on the host's `pkgs` — the module pulls hive-c0re's package +straight from `hyperhive.packages..default`. Just import the +module and the service is wired up. diff --git a/flake.nix b/flake.nix index 18f109c..1224fda 100644 --- a/flake.nix +++ b/flake.nix @@ -79,8 +79,17 @@ nixosModules = { agent-base = ./nix/templates/agent-base.nix; - hive-c0re = ./nix/modules/hive-c0re.nix; manager = ./nix/templates/manager.nix; + # The hive-c0re module wants `pkgs.hyperhive` for its default + # `services.hive-c0re.package`. To avoid making operators apply an + # overlay (which would also pollute their host pkgs with our + # build), we thread the package straight from this flake's + # `packages..default` via a `hyperhivePackage` argument. + # The `claude-unstable` overlay only matters inside our container + # builds (already applied internally in `nixosConfigurations`). + hive-c0re = import ./nix/modules/hive-c0re.nix { + hyperhivePackage = system: self.packages.${system}.default; + }; }; nixosConfigurations = diff --git a/hive-ag3nt/src/mcp.rs b/hive-ag3nt/src/mcp.rs index c33c319..bd16814 100644 --- a/hive-ag3nt/src/mcp.rs +++ b/hive-ag3nt/src/mcp.rs @@ -66,11 +66,7 @@ impl From for SocketReply { /// Format helper for "send-like" tools (anything that expects an `Ok`). /// `tool` and `ok_msg` only appear in the result string; they don't change /// behavior. -pub fn format_ack( - resp: Result, - tool: &str, - ok_msg: String, -) -> String { +pub fn format_ack(resp: Result, tool: &str, ok_msg: String) -> String { match resp { Ok(SocketReply::Ok) => ok_msg, Ok(SocketReply::Err(m)) => format!("{tool} failed: {m}"), @@ -274,7 +270,10 @@ impl ManagerServer { /// Helper: issue any `ManagerRequest`, convert the reply through /// `SocketReply`. Manager tools that just need an `Ok` ack share this. - async fn dispatch(&self, req: hive_sh4re::ManagerRequest) -> Result { + async fn dispatch( + &self, + req: hive_sh4re::ManagerRequest, + ) -> Result { client::request::<_, hive_sh4re::ManagerResponse>(&self.socket, &req) .await .map(SocketReply::from) diff --git a/hive-ag3nt/src/web_ui.rs b/hive-ag3nt/src/web_ui.rs index f7c8611..1b5be97 100644 --- a/hive-ag3nt/src/web_ui.rs +++ b/hive-ag3nt/src/web_ui.rs @@ -295,8 +295,4 @@ fn html_escape(s: &str) -> String { .replace('"', """) } -const STYLE: &str = concat!( - "", -); +const STYLE: &str = concat!("",); diff --git a/hive-c0re/src/dashboard.rs b/hive-c0re/src/dashboard.rs index 6492c8e..30c90ee 100644 --- a/hive-c0re/src/dashboard.rs +++ b/hive-c0re/src/dashboard.rs @@ -312,11 +312,7 @@ fn render_diff_lines(diff: &str) -> String { Some(b'-') => "diff-del", _ => "diff-ctx", }; - let _ = writeln!( - out, - "{}", - html_escape(raw), - ); + let _ = writeln!(out, "{}", html_escape(raw),); } out } diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 6b95ffd..1775664 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -1,3 +1,4 @@ +{ hyperhivePackage }: { pkgs, lib, @@ -12,8 +13,8 @@ in enable = lib.mkEnableOption "hive-c0re — hyperhive coordinator daemon"; package = lib.mkOption { type = lib.types.package; - default = pkgs.hyperhive; - defaultText = lib.literalExpression "pkgs.hyperhive"; + default = hyperhivePackage pkgs.stdenv.hostPlatform.system; + defaultText = lib.literalExpression "hyperhive.packages.\${system}.default"; description = "Package that provides /bin/hive-c0re."; }; hyperhiveFlake = lib.mkOption {