Totally doable. How effective it is will depend on your location & how much PV capacity you can install.
Our 150 litre chauffe eau gains power from PV generation all year round. In the summer, unless we have guests, we never use any mains to heat hot water. Even in the depths of winter we get some contribution on sunny days.
There is another thread about related matters, & the subject of using surplus PV power to drive things.
Any such system will be better off using the PV across your entire supply, with the chauffe eau only using solar when you have a surplus.