From dbacac5678f3f800a68f9e33542d6aa12ef38bcb Mon Sep 17 00:00:00 2001 From: Markus Hauck Date: Mon, 11 May 2026 11:14:11 +0200 Subject: [PATCH] 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. --- pkgs/by-name/cl/claude-code/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/cl/claude-code/package.nix b/pkgs/by-name/cl/claude-code/package.nix index ace41055c5f9..e7b6b4190de9 100644 --- a/pkgs/by-name/cl/claude-code/package.nix +++ b/pkgs/by-name/cl/claude-code/package.nix @@ -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)