From 9efe6f64b687e13f0e204d4a296e2030515a638c Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 2 Aug 2026 20:54:03 +0200 Subject: [PATCH] move swaggerUiTheme nix option out of c0re's namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit services.hyperhive.c0re.swaggerUiTheme -> services.hyperhive.gateway.swaggerUiTheme. hive-c0re has no relationship to this option (it's consumed entirely by the gateway's nginx config) since the previous two commits moved the theme files out of hive-c0re/ and gateway to hosting the whole dist itself — the option shouldn't live in c0re's namespace either. Pure option move: default wiring in flake.nix now sets services.hyperhive.gateway.swaggerUiTheme instead of the c0re one; hive-gateway/default.nix reads it via the module's own already-bound cfg (services.hyperhive.gateway) instead of reaching into c0re's. Verified: nix build .#swagger-ui-theme unaffected (same store path, pure option-plumbing change, no content change); a full nixosSystem eval of nixosModules.default resolves the option at its new path and confirms the gateway's /api/docs/ location still aliases the correct store path. --- flake.nix | 4 +++- nix/host-modules/hive-c0re/options.nix | 13 ------------- nix/host-modules/hive-gateway/default.nix | 5 +++-- nix/host-modules/hive-gateway/options.nix | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index ae0af5ee..87d4f7e4 100644 --- a/flake.nix +++ b/flake.nix @@ -128,7 +128,6 @@ frontend = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.frontend; assets = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.assets; xdgIcons = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.xdg-icons; - swaggerUiTheme = lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.swagger-ui-theme; hyperhiveFlake = lib.mkDefault "${sources.hyperhiveFlakeSource}"; # Narrow docs/ source, threaded as its own meta-flake input # so doc edits don't re-hash the whole flake source. @@ -143,6 +142,9 @@ agentBaseToplevel = lib.mkDefault self.packages.x86_64-linux.agent-base-toplevel; managerToplevel = lib.mkDefault self.packages.x86_64-linux.ruth-toplevel; }; + services.hyperhive.gateway.swaggerUiTheme = + lib.mkDefault + self.packages.${pkgs.stdenv.hostPlatform.system}.swagger-ui-theme; }; hive-ci = ./nix/host-modules/hive-ci.nix; hive-forge = ./nix/host-modules/hive-forge; diff --git a/nix/host-modules/hive-c0re/options.nix b/nix/host-modules/hive-c0re/options.nix index c5d7088b..bd10cecd 100644 --- a/nix/host-modules/hive-c0re/options.nix +++ b/nix/host-modules/hive-c0re/options.nix @@ -65,19 +65,6 @@ processes to their icon. ''; }; - swaggerUiTheme = lib.mkOption { - type = lib.types.package; - defaultText = lib.literalExpression "hyperhive.packages.\${system}.swagger-ui-theme"; - description = '' - Full Swagger UI static dist, hyperhive-themed (see - `nix/packages/swagger-ui-theme.nix`, built on - `nix/packages/swagger-ui-dist.nix`). hive-gateway serves this - whole tree directly at `/api/docs/` — hive-c0re hosts none of - it, only the dynamic `/api/openapi.json` route. Override to - ship a custom theme (or the plain vendored dist) without a - hive-c0re rebuild. - ''; - }; hyperhiveFlake = lib.mkOption { type = lib.types.str; defaultText = lib.literalMD "the hyperhive flake's own filtered source store path"; diff --git a/nix/host-modules/hive-gateway/default.nix b/nix/host-modules/hive-gateway/default.nix index 28453f06..a9df82c5 100644 --- a/nix/host-modules/hive-gateway/default.nix +++ b/nix/host-modules/hive-gateway/default.nix @@ -27,8 +27,9 @@ let # Full hyperhive-themed Swagger UI dist — nginx serves this whole # tree straight from the store at /api/docs/, no hive-c0re fallback # (see vhosts.nix's `swaggerUiLocations` and - # nix/packages/swagger-ui-{dist,theme}.nix). - swaggerUiTheme = config.services.hyperhive.c0re.swaggerUiTheme; + # nix/packages/swagger-ui-{dist,theme}.nix). Own option under this + # module (not c0re's) — hive-c0re has no relationship to it. + swaggerUiTheme = cfg.swaggerUiTheme; # Self-signed TLS is the implicit floor: when neither an operator cert # (`tls.certDir`) nor ACME (`tls.acme.enable`) is configured, the gateway diff --git a/nix/host-modules/hive-gateway/options.nix b/nix/host-modules/hive-gateway/options.nix index 211a8c3a..9f3ed563 100644 --- a/nix/host-modules/hive-gateway/options.nix +++ b/nix/host-modules/hive-gateway/options.nix @@ -254,6 +254,21 @@ in }; }; + swaggerUiTheme = lib.mkOption { + type = lib.types.package; + defaultText = lib.literalExpression "hyperhive.packages.\${system}.swagger-ui-theme"; + description = '' + Full Swagger UI static dist, hyperhive-themed (see + `nix/packages/swagger-ui-theme.nix`, built on + `nix/packages/swagger-ui-dist.nix`). The gateway serves this + whole tree directly at `/api/docs/` — hive-c0re hosts none of + it, only the dynamic `/api/openapi.json` route (proxied + through, unaffected by this option). Override to ship a + custom theme (or the plain vendored dist) without a gateway + rebuild. + ''; + }; + hsts = { enable = lib.mkOption { type = lib.types.bool;