Potential energy curves for NiH and NiH2