From 8d3c43b16032dccfd46d232abde1dea772e5244f Mon Sep 17 00:00:00 2001 From: Padreug Date: Wed, 10 Jun 2026 17:13:05 +0200 Subject: [PATCH] feat: synthesize brand kit from appName when brandDir unset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds back `services.webapp.appName` (briefly removed in the previous commit per #100's strict policy) so existing hosts keep working without authoring full per-host brand kits. Resolution order: 1. If brandDir is set, use it (full brand kit wins). 2. Else synthesize: take the flake's default logo + a brand.json carrying appName as both name and shortName. This is NOT a VITE_APP_NAME env shim — it threads through the brand kit pipeline properly (brand.json read by vite-branding.ts). Hosts that need themed chrome / their own logo upgrade to a real brandDir. Co-Authored-By: Claude Opus 4.7 (1M context) --- webapp.nix | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/webapp.nix b/webapp.nix index 177ec21..41ee2e6 100644 --- a/webapp.nix +++ b/webapp.nix @@ -15,9 +15,28 @@ let cfg = config.services.webapp; + # Synthesize a brand kit from `appName` when no explicit brandDir is + # provided: take the flake's default logo and overlay a brand.json + # carrying the host's app name. This lets existing hosts keep + # `services.webapp.appName = "Bouge"` and get "Bouge" in the manifest + # WITHOUT needing to author a full brand kit per host. Hosts that DO + # author a brand kit (logo, theme colors) supply `brandDir` directly + # and `appName` becomes informational. + synthesizedBrand = pkgs.runCommand "aio-webapp-brand-${cfg.appName}" {} '' + mkdir -p $out + cp ${cfg.flake}/branding/default/logo.png $out/logo.png + cat > $out/brand.json <