Grepping nixpkgs is what i do as well, but for functions specifically i found https://noogle.dev/ to be useful.
Same experience with mkDerivation as well - I personally have lots of hope for https://github.com/DavHau/drv-parts and similar projects to improve that situation :)