Nanophotonic coherent light–matter interfaces based on rare-earth-doped crystals