From 5a420119df486e9db110a9f29faccbff4cd98708 Mon Sep 17 00:00:00 2001 From: Padreug Date: Wed, 1 Jul 2026 22:42:49 +0200 Subject: [PATCH] perf(deploy): slim the kiosk closure (disable TTS, Qt, docs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The disk image was ~6.2 GiB of closure, largely desktop/multimedia baggage a single-purpose Electron kiosk never uses. Cut the clearly-unused stacks: - services.speechd off → drops speech-dispatcher's espeak-ng + mbrola voices (~1 GB text-to-speech). An ATM does not talk. - v4l-utils built withGUI=false → drops the entire Qt6 stack (~0.5 GB) that only backed the qv4l2 GUI; the v4l2-ctl CLI we actually use for the camera stays. - documentation off (man/info/NixOS manual) — nobody reads them on a kiosk. Closure 6.2 → 5.0 GiB. The remaining bulk is electron's own runtime (gtk4/ gstreamer/pipewire, unavoidable), mesa+llvm (GPU), and linux-firmware — those need heavier / riskier work to touch. Distribute the image as .img.zst. Co-Authored-By: Claude Opus 4.8 --- deploy/nixos/configuration.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/deploy/nixos/configuration.nix b/deploy/nixos/configuration.nix index d473a42..2306f5a 100644 --- a/deploy/nixos/configuration.nix +++ b/deploy/nixos/configuration.nix @@ -7,6 +7,16 @@ # System basics system.stateVersion = "24.05"; + # ── Image slimming (bitspire#70 sizing) ────────────────────────────── + # This is a single-purpose Electron kiosk; strip the desktop/multimedia + # baggage NixOS pulls in by default so the disk image stays lean. + # - speechd: text-to-speech (speech-dispatcher → espeak-ng → mbrola, ~1GB). + # An ATM does not talk. + # - documentation: man/info/NixOS manual — no one reads them on a kiosk. + services.speechd.enable = lib.mkForce false; + documentation.enable = false; + documentation.nixos.enable = false; + # Networking networking = { hostName = "bitspire"; @@ -121,8 +131,10 @@ # Node.js for the application pkgs-unstable.nodejs_22 - # Camera support - v4l-utils + # Camera support. v4l-utils' default build drags in the whole Qt6 stack + # for its qv4l2 GUI (~0.5GB) — we only ever use the v4l2-ctl CLI, so drop + # the GUI. + (v4l-utils.override { withGUI = false; }) fswebcam # ATM operations