Hacker symbol

August 5, 2022 ~ 1 min read

buildInputs vs nativeBuildInputs


I always forget the different between the type of build inputs in a nix derivation.

Here is my explanation.

buildInputs: are for libraries loaded during execution.

nativeBuildInputs: are compilation libraries

Sometimes the libraries of nativeBuildInputs are not populated correctly by pkg-config. If I ever find a solution to this I will post it here. The only working solution I have is:

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath nativeBuildInputs;

Sebastian BolaƱos

Hi, I'm Sebastian. I'm a software developer from Costa Rica. You can follow me on Twitter. I enjoy working on distributed systems.