Oldhamite is a calcium magnesium sulfide mineral with the chemical formula .