The following packages are tools primarily used during build so they likely go to nativeBuildInputs
, not buildInputs
:
cmake
meson
ninja
pkg-config
- and more…
The distinction primarily matters when cross-compiling a package for a different architecture than the one the build runs on – if you want to run a program during a package’s build, its host (runtime) architecture needs to match the package’s build architecture, or the operating system might not be able to execute it.
Dependencies listed in nativeBuildInputs
will ensure precisely that, while those in buildInputs
will have the same host platform as the built package.
Note: In most derivations, when not cross-compiling, the programs listed in buildInputs
will end up in PATH
environment variable for build too. But you can force the distinction by setting strictDeps = true;
; and python3.pkgs.buildPythonPackage
and rustPlatform.buildRustPackage
already enable that option by default.
- When building an environment for an IDE, you will likely want to be able to run the build tools at runtime so they should go to
buildInputs
(possibly to both).