Watch
0
0
Fork
You've already forked hyperhive
0

agent claude-code is built without its alsa-lib LD_LIBRARY_PATH wrapper

This commit is contained in:
atlas 2026-10-19 21:37:47 +02:00
commit cac634cb65
3 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,25 @@
# `claude-code` without the `--prefix LD_LIBRARY_PATH` alsa-lib entry
# nixpkgs adds to its wrapper. The wrapper exports the variable into
# claude's own environment, so every shell claude spawns inherits an
# alsa-lib `lib` dir that shadows the libraries newer nixpkgs binaries
# (headless chromium) were built against. Agents have no audio device,
# so alsa-lib is not needed. Every other wrapper flag stays.
#
# nixpkgs gives no switch for it (`alsa-lib` only feeds that one
# `makeLibraryPath`), so the line is dropped from `installPhase`. A
# package whose `installPhase` has no such line comes back unchanged.
lib: claudeCode:
let
marker = "--prefix LD_LIBRARY_PATH";
dropMarker =
phase:
lib.concatStringsSep "\n" (
builtins.filter (l: !(lib.hasInfix marker l)) (lib.splitString "\n" phase)
);
in
if lib.hasInfix marker (claudeCode.installPhase or "") then
claudeCode.overrideAttrs (old: {
installPhase = dropMarker old.installPhase;
})
else
claudeCode