fix: add LD_LIBRARY_PATH for bun-installed native addons on NixOS

Merged
SH
7mo ago
+17-0

Summary

  • Add LD_LIBRARY_PATH with alsa-lib, glib, libsecret, stdenv.cc.cc.lib, and zlib to fish, bash, and zsh shell configs (Linux only)
  • Install corresponding packages in home-manager/packages/default.nix
  • Fixes omp (oh-my-pi) crashing with libz.so.1: cannot open shared object file and similar errors for sharp, keytar, copilot, node-llama-cpp, etc.

Test plan

  • Rebuild NixOS / home-manager switch
  • Run omp — should no longer error about libz.so.1
  • Verify ldd on bun native addons shows no missing libs

🤖 Generated with Claude Code


Summary by cubic

Configure LD_LIBRARY_PATH for bun-installed native addons on NixOS and install system libs to stop load failures. Fixes errors like "libz.so.1: cannot open shared object file" in @oh-my-pi/pi-natives, sharp, keytar, node-llama-cpp, and others.

  • Bug Fixes
    • Export LD_LIBRARY_PATH on Linux in bash, zsh, and fish to include libs from alsa-lib, glib, libsecret, stdenv.cc.cc.lib, and zlib.
    • Add the same packages to Home Manager Linux packages so the libraries are present.
    • Append alsa-lib only on Linux using lib.optionals to avoid aarch64-darwin evaluation errors.