The chemical reactions and pathways involving nitroimidazoles, imidazole derivatives with a nitro group attached to one ring.