why this isn't used as a weapon more frequently, lets say by strapping a hyperdrive to chunks of rock?
Let's make this rock even more effective and add an explosive device to it so it does even more damage on impact. Oh, wait, we've just invented missiles.
So why aren't they using missiles?
The Star Wars universe leans heavily into laser as opposed to kinetic weaponry. The main issue with kinetics is that kinetic energy requires physical mass, so any ship is limited by what ammunition it can carry. You cannot be self sustaining or travel indefinitely if your ammo is a non-renewable resource.
But lasers are unlimited as long as you can generate (or harvest) power.
Power generation is not an issue in the Star Wars universe for day-to-day ship affairs, so it makes much more sense to carry an unlimited amount of laser shots than a limited amount of kinetic shots.
Imagine how many hyperdrives you'd have to build, attach, and destroy in the process. Factor in the misses, and the sheer amount of rocks you'd need to hoard to make this an effective long term strategy.
Also, you'd need more than just a hyperdrive. How are you going to orient your rock correctly? You're going to need several thrusters to accomplish this. 6 thrusters for linear movement in all 3 directions, and additional thrusters for the 3 axes of rotation.
Since you don't want this rock to be manned for obvious reasons, how is this rock going to be steered? You're going to need an antenna at the very least, and the Star Wars equivalent of a probe cockpit for to execute the maneuvers.
Oh and also, you better hope your enemies are near an asteroid field. Or are you going to carry your rock collection around with you? Well now you either need to load them on the ship, or provide your rocks with means of travelling by themselves.
If you keep them on your ship, whenever you release them they're going to be sitting ducks. You'd want them to hit your enemies from unexpected directions, so your rocks need the ability to fly all over the place, so you're going to need to put some sort of power reactor on your individual rocks (note that this presumes you'd have been using some sort of one-time-use battery for your hyperdrive shot - otherwise you'd already need a generator for the hyperdrive).
And then we need to account for how many of these rocks are going to miss their target. If we need to fire 10 rocks to hit once, that is a hell of a lot of work for the amount of damage that a laser could easily cause in less time.
If you want a ballpark estimate of how much ammo is wasted in general miltary affairs: One out of every 250,000 bullets shipped by the US to Iraq/Afghanistan killed an enemy combatant. That's a 0.0004% hit rate.
If the US is not capable of sustaining its own bullet supply, think of what it would take to build hyperdrives, thrusters, probe cockpits, power generators and antennae. You might say "well there's many planets!", but keep in mind that all of this equipment has to be ferried around. The logistical challenge alone would be a nightmare.
You're going to need a lot of hyperdrives.
Oh and also, that's not even factoring in the relative mass difference between your rock and your target ship, which others have already written answers on. I've assumed (for optimism's sake) that adding hyperdrive speed to an object adds enough energy for it to significantly damage any target (no matter the mass/size) that's not in hyperdrive.