Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/packages/swagger-ui-theme.nix
atlas b4c5954491 move the hive's vhosts and matrix discovery out of the gateway
The dashboard vhost, the hive domain vhost and the dashboard's local
name move to hive-c0re/vhosts.nix; the matrix .well-known discovery and
the legacy /matrix/ redirect move to glue-matrix-hive-discovery.nix,
which adds them to the hive domain vhost. Both declare through
gateway.vhosts. hive-gateway/vhosts.nix keeps the catch-all only, and
the gateway no longer reads deploy.matrix or c0re.servedFrontend, nor
deploy.hive-controller.enable for its vhosts.

Part of #3742.
2026-10-17 15:07:33 +02:00

52 lines
2.2 KiB
Nix

{
stdenv,
swagger-ui-dist,
}:
# hyperhive's Catppuccin Mocha re-theme of Swagger UI: overlays our 3
# 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-c0re/vhosts.nix).
#
# Output layout: every file from `swagger-ui-dist`, with 3 replaced:
# index.html adds colors.css (live stylix theme) +
# hyperhive-theme.css <link>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, 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";
dontUnpack = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ${swagger-ui-dist}/. $out/
chmod -R u+w $out
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
'';
meta = {
description = "hyperhive Swagger UI Catppuccin Mocha re-theme — full static dist, nginx-served at /api/docs/";
homepage = "https://forge.darkest.space/hyperhive/hyperhive";
};
}