hyperhive/nix/packages/swagger-ui-theme.nix

49 lines
1.7 KiB
Nix

{
stdenv,
}:
# The hand-authored Swagger UI re-theme files (`hive-c0re/swagger-ui-
# theme/`), shipped as a standalone derivation so the gateway can
# `alias` them straight from the nix store instead of hive-c0re's own
# build serving them — see nix/host-modules/hive-gateway/vhosts.nix's
# `swaggerThemeLocations`. This is what lets a CSS tweak ship as a
# gateway config change (activate the gateway container) rather than a
# hive-c0re rebuild+restart: the two files nginx exact-matches
# (`/api/docs/` and `/api/docs/hyperhive-theme.css`) come from here;
# every other Swagger UI asset (bundle.js, openapi.json, favicons, …)
# still falls through the existing `/api/` prefix proxy to hive-c0re's
# own vendored (unthemed) `utoipa-swagger-ui` embed, unchanged.
#
# Pure data: copied verbatim, no build step.
#
# Output layout:
# $out/index.html — themed index.html Swagger UI page
# $out/hyperhive-theme.css — the re-theme, consumes --baseNN vars
# from the dashboard's own colors.css
# (loaded via an absolute /static/
# colors.css <link>, same origin)
stdenv.mkDerivation {
pname = "hyperhive-swagger-ui-theme";
version = "0.1.0";
# Narrow src keeps this derivation's input hash decoupled from the
# rest of the tree — a theme tweak only re-hashes this.
src = ../../hive-c0re/swagger-ui-theme;
dontBuild = true;
dontConfigure = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ./* $out/
runHook postInstall
'';
dontFixup = true;
meta = {
description = "hyperhive Swagger UI Catppuccin Mocha re-theme (static override files)";
homepage = "https://forge.darkest.space/hyperhive/hyperhive";
};
}