From 61977514c6d76104fb3b641184c07e93661d1fe8 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 16 Aug 2026 17:13:55 +0200 Subject: [PATCH] swarm-ui: serve the hyperhive favicon Same pattern frontend.nix already uses for the dashboard: the SVG lives outside the npm tree at branding/hyperhive.svg, copied into $out during the nix install phase (not build.mjs, so plain npm build consumers still work, same split frontend.nix uses). Added the matching to index.html. --- frontend/packages/swarm-ui/src/index.html | 1 + nix/packages/default.nix | 4 +++- nix/packages/swarm-ui.nix | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/packages/swarm-ui/src/index.html b/frontend/packages/swarm-ui/src/index.html index 6766527b..7dd0b8fd 100644 --- a/frontend/packages/swarm-ui/src/index.html +++ b/frontend/packages/swarm-ui/src/index.html @@ -4,6 +4,7 @@ hyperhive swarm + diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 9fc145c4..d110005c 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -188,7 +188,9 @@ in # above, kept a separate package for the same reason: not every hive # runs the swarm controller, so this shouldn't ride along in # `packages.default`'s closure. - swarm-ui = pkgs.callPackage ./swarm-ui.nix { }; + swarm-ui = pkgs.callPackage ./swarm-ui.nix { + branding-svg = ../../branding/hyperhive.svg; + }; # Bundled browser assets — see ./frontend.nix. Output is # $out/{dashboard,agent}/ which the Rust binaries serve via diff --git a/nix/packages/swarm-ui.nix b/nix/packages/swarm-ui.nix index 6d750f43..035dc904 100644 --- a/nix/packages/swarm-ui.nix +++ b/nix/packages/swarm-ui.nix @@ -1,4 +1,4 @@ -{ buildNpmPackage }: +{ buildNpmPackage, branding-svg }: # Static build of the swarm-level UI shell (project-bootstrap scope: # empty start page, no functionality yet — see @@ -27,7 +27,9 @@ # `npm run build --workspaces` frontend.nix runs) via an explicit # `npm run build --workspace=…` buildPhase, so a dashboard/agent-only # change doesn't need to rebuild (or re-review the output of) this -# derivation. +# derivation. The favicon (`branding/hyperhive.svg`, same file +# `./frontend.nix` copies for the dashboard) is likewise copied in +# during install — it lives outside the npm tree. buildNpmPackage { pname = "hyperhive-swarm-ui"; @@ -48,6 +50,7 @@ buildNpmPackage { runHook preInstall mkdir -p $out cp -r packages/swarm-ui/dist/. $out/ + cp ${branding-svg} $out/favicon.svg runHook postInstall '';