claude-code: fix voice mode native module load on Linux

The bun-compiled binary embeds audio-capture.node (cpal + alsa-rs),
which dlopens libasound.so.2 at runtime. Because the native module
lives inside bun's virtual filesystem, autoPatchelfHook can't reach it
during the build, so on Linux the load fails and /voice prints the
"install SoX" fallback message.

Expose alsa-lib via LD_LIBRARY_PATH so the native module loads.
This commit is contained in:
Markus Hauck
2026-05-11 11:14:11 +02:00
parent 3735f76638
commit dbacac5678
+4 -1
View File
@@ -9,6 +9,7 @@
installShellFiles,
makeBinaryWrapper,
autoPatchelfHook,
alsa-lib,
procps,
ripgrep,
bubblewrap,
@@ -56,7 +57,9 @@ stdenv.mkDerivation (finalAttrs: {
--set-default FORCE_AUTOUPDATE_PLUGINS 1 \
--set DISABLE_INSTALLATION_CHECKS 1 \
--set USE_BUILTIN_RIPGREP 0 \
--prefix PATH : ${
${lib.optionalString stdenv.hostPlatform.isLinux ''
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ alsa-lib ]} \
''}--prefix PATH : ${
lib.makeBinPath (
[
# claude-code uses [node-tree-kill](https://github.com/pkrumins/node-tree-kill) which requires procps's pgrep(darwin) or ps(linux)