Apparently, Nigel Hayes will have to learn to live with it — the dirty city, that is.

The former Wisconsin standout has agreed to a partially guaranteed deal with the Knicks, according to ESPN’s Adrian Wojnarowski.

The 6-foot-8 power forward, who averaged 14 points and 6.6 rebounds per game as a senior and played with the Knicks’ summer-league team last month, made headlines back in March while in town with the Badgers for the NCAA Tournament. He said he didn’t like New York, calling it “too big” and “dirty.”

“There’s trash everywhere,” Hayes said at the time. “There’s too many people. And it’s cold right now. It’s nice to look at in the movies and stuff, but I’ve had my share of it. I’m just trying to come here and win some basketball games.”

And as for if the Knicks drafted him?

“You’d have no choice,’’ the Toledo, Ohio native said. “It’s just something you’d have to live with it.”

Hayes’ agent told The Post in June that Hayes was “completely joking.” Hayes may now get a chance to prove it.