This makes it possible to reuse this functionality as a hook in derivations that do not use buildRustPackage.