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%. read more
One of the gamma interactions with matter is the photoelectric effect for low energetic gammas and other is pair production for high energetic gammas, the first is well known for electricity production (charging batteries with sun light) and migh be used when going away from the star, the second might be used but those energetic gammas are not as usual then others. read more