Yes, it's been tried.
Hashizume et al. attempted to use semiconductors (variants of which are also used in normal solar cells) which were subjected to gamma radiation from a radioactive isotope of cobalt. They generated up to 0.2 Watts/meter² — certainly not a lot. The energy conversion efficiency? 1%. Furthmore, the cells were, as the authors put it, "unstable". However, none of this means that this method won't work — it just won't be very effective in the near future.
For comparison, solar cells can generate energy at about 25% efficiency, and solar irradiance is orders of magnitude higher than what was generated by these gamma-ray semiconductors (1361 Watts/meter²). These devices won't be widespread any time soon.
I suppose you could try to use something like a radioisotope thermoelectric generator, which produces heat via radioactive decay and then converts that heat into energy. However . . .
- These devices avoid gamma radiation because it is too energetic.
- You'd need materials more radioactive than normal to generate the required gamma rays.
- Nuclear power is not wholly popular as is. You'd have to convince a lot of people that the whole setup is safe in order to deploy it on a large scale.
Jan Dvorak suggested essentially surrounding a reactor with electricity-generating semiconductor cells sensitive to gamma rays, which would both generate electricity and perhaps provide some radiation shielding. It's an interesting thought, and could certainly work. I do wonder what the irradiation would be at different points within the reactor chamber.