From f08a0a5d097515ac6a41e81c4397a7aa8352cfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Mon, 2 Nov 2026 20:34:13 +0100 Subject: [PATCH] nix: hyperhive-the-movie app (gource history movie), replaces gource.sh --- flake.nix | 10 ++++ nix/packages/default.nix | 5 ++ nix/packages/hyperhive-the-movie.nix | 82 ++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 nix/packages/hyperhive-the-movie.nix diff --git a/flake.nix b/flake.nix index 064d86df..e1e4f037 100644 --- a/flake.nix +++ b/flake.nix @@ -69,6 +69,16 @@ } ); + apps = forAllSystems ( + { system, ... }: + { + hyperhive-the-movie = { + type = "app"; + program = "${self.packages.${system}.hyperhive-the-movie}/bin/hyperhive-the-movie"; + }; + } + ); + nixosModules = let # Package wiring for agent containers — the harness modules diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 266f5dc3..2eb31485 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -149,6 +149,11 @@ in } // binPkgs // { + # `nix run .#hyperhive-the-movie`: gource over the cwd repo's history. + hyperhive-the-movie = pkgs.callPackage ./hyperhive-the-movie.nix { + logo = ../../branding/hyperhive.png; + }; + # Swarm-level controller daemon. Deliberately NOT in `daemonBins`: # that list is the core stack — the binaries hive-c0re and the agent # harness are made of — and it drives the `default` bundle that diff --git a/nix/packages/hyperhive-the-movie.nix b/nix/packages/hyperhive-the-movie.nix new file mode 100644 index 00000000..8faf153e --- /dev/null +++ b/nix/packages/hyperhive-the-movie.nix @@ -0,0 +1,82 @@ +# `nix run .#hyperhive-the-movie` — gource visualisation of the git +# history of the repo it is run from. `-- --record` renders +# gource-hyperhive.mp4 in the cwd instead of opening a window. +{ + lib, + writeShellApplication, + gource, + ffmpeg, + xvfb-run, + librsvg, + curl, + git, + coreutils, + gnugrep, + logo, +}: +writeShellApplication { + name = "hyperhive-the-movie"; + runtimeInputs = [ + gource + ffmpeg + xvfb-run + librsvg + curl + git + coreutils + gnugrep + ]; + text = '' + record=false + [[ "''${1:-}" == "--record" ]] && record=true + + cd "$(git rev-parse --show-toplevel)" + + # Per-agent avatars from the local forge (same icons the dashboard + # uses), rasterised because --user-image-dir needs png. Cached. + # müde is the human operator: no forge icon. + avatar_dir="''${XDG_CACHE_HOME:-$HOME/.cache}/hyperhive-the-movie/avatars" + mkdir -p "$avatar_dir" + while IFS= read -r author; do + [[ "$author" == "müde" || -f "$avatar_dir/$author.png" ]] && continue + svg="$avatar_dir/$author.svg" + curl -sSf "http://localhost/agent/$author/icon" -o "$svg" 2>/dev/null || rm -f "$svg" + # unknown agents get a 200 html fallback page, not a 404 + if [[ -f "$svg" ]]; then + if head -c 200 "$svg" | grep -qi '