Like amphotericin B and natamycin, nystatin binds to ergosterol, a major component of the fungal cell membrane. When present in sufficient concentrations, it forms pores in the membrane that lead to K+ leakage, acidification, and death of the fungus. Ergosterol is unique to fungi, so the drug does not have such catastrophic effects on animals or plants. However, many of the systemic/toxic effects of Nystatin are attributable to its effect on human cells via binding to mammalian sterols, namely cholesterol. This is the effect that accounts for the nephrotoxicity observed when high serum levels of Nystatin are achieved.
Maybe this review helps to understand what antifungal agents like amphotericin B and nystatin or other polyene macrolides do:
Jacques Bolard: Biochimica et Biophysica Acta 864 (1986) 257-304 257, "How do the polyene macroUde antibiotics affect the cellular membrane properties?"