How to remove find from PATH, but not locate?

I’m creating target containers to scan with a vulnerability scanner my company develops.

It works by using find to search for common programs, to see if the version has known vulnerabilities. When locate is installed, it is used first and only if locate don’t finds it, find is used. Since my locate database contains all installed binaries, find is unnecessary.

So how do i achieve that find is not in PATH, even tho locate is (both from package findutils). Using mlocate is not an option, since the nixos module description says it only works for root.

It works by using find to search for common programs, to see if the version has known vulnerabilities. When locate is installed, it is used first and only if locate don’t finds it, find is used. Since my locate database contains all installed binaries, find is unnecessary.

It’s just about the PATH? Remove findutils, then add a «package» which is more or less «runCommand “just-locate” {} “mkdir -p $out/bin && ln -s ${findutils}/bin/locate $out/bin”» to PATH