Metal-insulator transition in NiS2