In a recent study [S. Das, J. H. Snoeijer, and D. Lohse, Phys. Rev. E 82, 056310 (2010)], we provided quantitative demonstration of the conjecture [W. A. Ducker, Langmuir 25, 8907 (2009)] that the presence of impurities at the surface layer (or the air-water interface) of surface nanobubbles can substantially lower the gas-side contact angle and the Laplace pressure of the nanobubbles. Through an analytical model for any general air-water interface without nonideality effects, we showed that a large concentration of soluble impurities at the air-water interface of the nanobubbles ensures significantly small contact angles (matching well with the experimental results) and Laplace pressure (though large enough to forbid stability). In this paper this general model is extended to incorporate the effect of nonidealities at the air-water interface in impurity-induced alteration of surface nanobubble properties. Such nonideality effects arise from finite enthalpy or entropy of mixing or finite ionic interactions of the impurity molecules at the nanobubble air-water interface and ensure significant lowering of the nanobubble contact angle and Laplace pressure even at relatively small impurity coverage. In fact for impurity molecules that show enhanced tendency to get adsorbed at the nanobubble air-water interface from the bulk phase, impurity-induced lowering of the nanobubble contact angle is witnessed for extremely small bulk concentration. Surface nanobubble experiments being typically performed in an ultraclean environment, the bulk concentration of impurities is inevitably very small, and in this light the present calculations can be viewed as a satisfactory explanation of the conjecture that impurities, even in trace concentration, have significant impact on surface nanobubbles.