stdenv (on linux) depends on gawk, readline and similar are useless for non-interactive usage.
Close#1596. Original patch was almost completely rewritten by vcunat.
On darwin we always specify whether to use readline, so it isn't always picked as reported.