High-pressure study of layered nitride superconductors