I'm sure it's something that can be engineered away and optimized in the Nix core though. Because yeah it isn't a hyperspecialized tool for specifically git hooks alone written in Rust. No.
It's not a saw nor a hammer. It's an entire workshop.
Flakes are less of a workshop, but more like a bus with tools or a heavy-duty toolbox.