Homogeneous and nanocomposite rare-earth-activated glasses for photonic devices