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 <link rel="icon"> to index.html.
This commit is contained in:
iris 2026-08-16 17:13:55 +02:00
commit 61977514c6
3 changed files with 9 additions and 3 deletions

View file

@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>hyperhive swarm</title> <title>hyperhive swarm</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="static/colors.css"> <link rel="stylesheet" href="static/colors.css">
<link rel="stylesheet" href="static/theme.css"> <link rel="stylesheet" href="static/theme.css">
<link rel="stylesheet" href="static/swarm-ui.css"> <link rel="stylesheet" href="static/swarm-ui.css">

View file

@ -188,7 +188,9 @@ in
# above, kept a separate package for the same reason: not every hive # above, kept a separate package for the same reason: not every hive
# runs the swarm controller, so this shouldn't ride along in # runs the swarm controller, so this shouldn't ride along in
# `packages.default`'s closure. # `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 # Bundled browser assets — see ./frontend.nix. Output is
# $out/{dashboard,agent}/ which the Rust binaries serve via # $out/{dashboard,agent}/ which the Rust binaries serve via

View file

@ -1,4 +1,4 @@
{ buildNpmPackage }: { buildNpmPackage, branding-svg }:
# Static build of the swarm-level UI shell (project-bootstrap scope: # Static build of the swarm-level UI shell (project-bootstrap scope:
# empty start page, no functionality yet — see # empty start page, no functionality yet — see
@ -27,7 +27,9 @@
# `npm run build --workspaces` frontend.nix runs) via an explicit # `npm run build --workspaces` frontend.nix runs) via an explicit
# `npm run build --workspace=…` buildPhase, so a dashboard/agent-only # `npm run build --workspace=…` buildPhase, so a dashboard/agent-only
# change doesn't need to rebuild (or re-review the output of) this # 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 { buildNpmPackage {
pname = "hyperhive-swarm-ui"; pname = "hyperhive-swarm-ui";
@ -48,6 +50,7 @@ buildNpmPackage {
runHook preInstall runHook preInstall
mkdir -p $out mkdir -p $out
cp -r packages/swarm-ui/dist/. $out/ cp -r packages/swarm-ui/dist/. $out/
cp ${branding-svg} $out/favicon.svg
runHook postInstall runHook postInstall
''; '';