makes
makes copied to clipboard
Support `nixpkgsBuildInputs` in `makeSearchPaths`
After trying to update to the latest commit of Nixpkgs I found some packages not to be self-contained via declarative setup code (normally a wrapper that expose a few env vars and then call the main code) but instead of $out/nix-support magic. This magic is normally triggered with a $ source $stdenv/setup)
Since here at Makes we don't use setup hooks because they are anti-modular, as the Nixpkgs documentation says:

We can instead offer a small attribute nixpkgsBuildInputs in makeSearchPaths to expose a compatibility layer. This compatibility layer can be achieved as simple as this:
{
__envNixpkgsSrc = __nixpkgsSrc__;
__envNixpkgsBuildInputs = [
__nixpkgs__.gnugrep
__nixpkgs__.python3Packages.chardet
__nixpkgs__.rpl
];
__envNixpkgsInitialPath = [ __nixpkgs__.coreutils ];
}
export buildInputs="${__envNixpkgsBuildInputs}"
export initialPath="${__envNixpkgsInitialPath}"
source "${__envNixpkgsSrc}/pkgs/stdenv/generic/setup.sh"
In the order of evaluation, nixpkgs should come first, then makes, so makes overrides nixpkgs