From 9d60f009341b4a3850a3badad5207ad78988ad49 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 1 Aug 2026 11:22:20 +0700 Subject: [PATCH] fix(infra): add ffmpeg + yt-dlp to gmw-discord-gateway runtime Root cause voice tidak berfungsi di produksi: ffmpeg & yt-dlp cuma ada di devShell, bukan di package discord-gateway. Bukti dari log gateway: 'FFmpeg/avconv not found!' saat voice:transmit:start (mic -> Discord), yang juga mematikan music playback (StreamType.Arbitrary butuh ffmpeg) dan segment muxing rekaman. - buildInputs: pkgs.ffmpeg-headless + pkgs.yt-dlp - wrapper export PATH ke keduanya sebelum exec node Verifikasi: nix build PASS; closure berisi ffmpeg-8.1.2 + yt-dlp-2026.07.04; wrapper PATH mengarah ke keduanya; ffmpeg/yt-dlp jalan. --- flake.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flake.nix b/flake.nix index 649c937..30fd7b1 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,11 @@ WRAPPER pkgs.cacert ]; + # Runtime tools for the voice pipeline: ffmpeg (mic transmit encode, + # music stream decode, segment muxing) and yt-dlp (YouTube/Spotify/ + # search media resolution). Must be on PATH inside the wrapper below. + buildInputs = [ pkgs.ffmpeg-headless pkgs.yt-dlp ]; + buildPhase = pnpmInstall + '' echo "=== Compiling TypeScript ===" npx tsc 2>&1 @@ -154,6 +159,7 @@ WRAPPER cat > $out/bin/gmw-discord-gateway << WRAPPER #!${pkgs.runtimeShell} cd $out/lib/gmw-discord-gateway +export PATH=${pkgs.ffmpeg-headless}/bin:${pkgs.yt-dlp}/bin:\$PATH exec ${nodejs}/bin/node dist/index.js WRAPPER chmod +x $out/bin/gmw-discord-gateway