feat: add nix-ld and LIBRARY_PATH for mason.nvim and other downloaded binaries

This commit is contained in:
Ryan Yin
2024-07-25 23:25:33 +08:00
parent aa0e1d84e0
commit b7b913b444
2 changed files with 47 additions and 0 deletions

View File

@@ -30,6 +30,27 @@ in {
viAlias = true;
vimAlias = true;
# These environment variables are needed to build and run binaries
# with external package managers like mason.nvim.
#
# LD_LIBRARY_PATH is also needed to run the non-FHS binaries downloaded by mason.nvim.
# it will be set by nix-ld, so we do not need to set it here again.
extraWrapperArgs = with pkgs; [
# LIBRARY_PATH is used by gcc before compilation to search directories
# containing static and shared libraries that need to be linked to your program.
"--suffix"
"LIBRARY_PATH"
":"
"${lib.makeLibraryPath [stdenv.cc.cc zlib]}"
# PKG_CONFIG_PATH is used by pkg-config before compilation to search directories
# containing .pc files that describe the libraries that need to be linked to your program.
"--suffix"
"PKG_CONFIG_PATH"
":"
"${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [stdenv.cc.cc zlib]}"
];
# Currently we use lazy.nvim as neovim's package manager, so comment this one.
#
# NOTE: These plugins will not be used by astronvim by default!