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.
This commit is contained in:
@@ -112,6 +112,11 @@ WRAPPER
|
|||||||
pkgs.cacert
|
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 + ''
|
buildPhase = pnpmInstall + ''
|
||||||
echo "=== Compiling TypeScript ==="
|
echo "=== Compiling TypeScript ==="
|
||||||
npx tsc 2>&1
|
npx tsc 2>&1
|
||||||
@@ -154,6 +159,7 @@ WRAPPER
|
|||||||
cat > $out/bin/gmw-discord-gateway << WRAPPER
|
cat > $out/bin/gmw-discord-gateway << WRAPPER
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
cd $out/lib/gmw-discord-gateway
|
cd $out/lib/gmw-discord-gateway
|
||||||
|
export PATH=${pkgs.ffmpeg-headless}/bin:${pkgs.yt-dlp}/bin:\$PATH
|
||||||
exec ${nodejs}/bin/node dist/index.js
|
exec ${nodejs}/bin/node dist/index.js
|
||||||
WRAPPER
|
WRAPPER
|
||||||
chmod +x $out/bin/gmw-discord-gateway
|
chmod +x $out/bin/gmw-discord-gateway
|
||||||
|
|||||||
Reference in New Issue
Block a user