This is done by specifying pkg-config in the makeFlags, ensuring that the correct pkg-config is injected. Depends on changes that are currently only in staging: -07ecf87693-4f6ec19dbcSee https://github.com/NixOS/nixpkgs/pull/114902 for those changes.