From 3ef166738cb648c995066e2c9e6fae350b947200 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 2 Aug 2026 20:49:59 +0200 Subject: [PATCH] move swagger-ui-theme/ out of hive-c0re/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hive-c0re doesn't touch these files anymore (nginx hosts them directly, see the previous commit) — hive-c0re/swagger-ui-theme/ was a leftover from the original SWAGGER_UI_OVERWRITE_FOLDER build-hook design, which this PR moved away from. New location matches the existing top-level-directory-for-nix-packaged-assets convention (branding/, claude-plugins/). Pure rename, no content change: nix/packages/swagger-ui-theme.nix's three file references updated, everything else picks it up from the same content hash (nix build .#swagger-ui-theme resolves to the exact same store path as before the move). --- nix/packages/swagger-ui-theme.nix | 46 ++++++++----------- .../hyperhive-theme.css | 0 .../index.html | 0 .../swagger-initializer.js | 0 4 files changed, 20 insertions(+), 26 deletions(-) rename {hive-c0re/swagger-ui-theme => swagger-ui-theme}/hyperhive-theme.css (100%) rename {hive-c0re/swagger-ui-theme => swagger-ui-theme}/index.html (100%) rename {hive-c0re/swagger-ui-theme => swagger-ui-theme}/swagger-initializer.js (100%) diff --git a/nix/packages/swagger-ui-theme.nix b/nix/packages/swagger-ui-theme.nix index a84cb6e0..f93c5e40 100644 --- a/nix/packages/swagger-ui-theme.nix +++ b/nix/packages/swagger-ui-theme.nix @@ -4,35 +4,29 @@ }: # hyperhive's Catppuccin Mocha re-theme of Swagger UI: overlays our 3 -# hand-authored override files (`hive-c0re/swagger-ui-theme/`) onto +# hand-authored override files (`swagger-ui-theme/`, top-level — not +# under `hive-c0re/`, which has no relationship to these files) onto # the plain vendored dist (./swagger-ui-dist.nix). This is the FULL # tree hive-gateway's nginx serves at `/api/docs/` — hive-c0re hosts # none of it, only the dynamic `/api/openapi.json` (see # nix/host-modules/hive-gateway/vhosts.nix). # # Output layout: every file from `swagger-ui-dist`, with 3 replaced: -# index.html — adds s for colors.css (live stylix -# theme, same origin) + hyperhive-theme.css -# hyperhive-theme.css — new; the re-theme itself, consumes -# --baseNN vars from colors.css -# swagger-initializer.js — hardcodes `url: "/api/openapi.json"`. The -# plain vendored copy points at the -# swagger.io petstore demo; normally -# `utoipa-swagger-ui`'s `serve()` rewrites -# this file per-request from a `{{config}}` -# placeholder it injects at its OWN build -# time (see that crate's `build.rs`'s -# `replace_default_url_with_config` + -# `format_config`). hive-c0re no longer -# serves this file at all, so that rewrite -# has to happen here instead — this copy is -# hand-verified to byte-match what -# `format_config` would produce for -# hive-c0re's actual config (single unnamed -# url, otherwise all `Config` defaults): the -# same transform applied to the real -# vendored file, not hand-typed from -# scratch. +# index.html adds colors.css (live stylix theme) + +# hyperhive-theme.css s +# hyperhive-theme.css new; the re-theme, consumes --baseNN vars +# swagger-initializer.js hardcodes `url: "/api/openapi.json"` — +# `utoipa-swagger-ui`'s `serve()` normally +# rewrites this per-request from a +# `{{config}}` placeholder its OWN build.rs +# injects (`replace_default_url_with_config` +# + `format_config`); hive-c0re doesn't serve +# this file at all anymore, so that rewrite +# is baked in statically here instead — +# hand-verified byte-for-byte against what +# `format_config` would produce, by applying +# the same transform to the real vendored +# file rather than typing it from scratch. stdenv.mkDerivation { pname = "hyperhive-swagger-ui-theme"; version = "0.1.0"; @@ -45,9 +39,9 @@ stdenv.mkDerivation { mkdir -p $out cp -r ${swagger-ui-dist}/. $out/ chmod -R u+w $out - install -m644 ${../../hive-c0re/swagger-ui-theme/index.html} $out/index.html - install -m644 ${../../hive-c0re/swagger-ui-theme/hyperhive-theme.css} $out/hyperhive-theme.css - install -m644 ${../../hive-c0re/swagger-ui-theme/swagger-initializer.js} $out/swagger-initializer.js + install -m644 ${../../swagger-ui-theme/index.html} $out/index.html + install -m644 ${../../swagger-ui-theme/hyperhive-theme.css} $out/hyperhive-theme.css + install -m644 ${../../swagger-ui-theme/swagger-initializer.js} $out/swagger-initializer.js runHook postInstall ''; diff --git a/hive-c0re/swagger-ui-theme/hyperhive-theme.css b/swagger-ui-theme/hyperhive-theme.css similarity index 100% rename from hive-c0re/swagger-ui-theme/hyperhive-theme.css rename to swagger-ui-theme/hyperhive-theme.css diff --git a/hive-c0re/swagger-ui-theme/index.html b/swagger-ui-theme/index.html similarity index 100% rename from hive-c0re/swagger-ui-theme/index.html rename to swagger-ui-theme/index.html diff --git a/hive-c0re/swagger-ui-theme/swagger-initializer.js b/swagger-ui-theme/swagger-initializer.js similarity index 100% rename from hive-c0re/swagger-ui-theme/swagger-initializer.js rename to swagger-ui-theme/swagger-initializer.js