A person's nastiness is their characteristic of being hateful or spiteful. When you complain angrily about your meal at a restaurant, your nastiness isn't likely to help you get better food or service.
Nastiness in people is generally unpleasant and malicious. You might be disgusted by the nastiness of a political campaign, or alarmed by the nastiness of most comments on a newspaper's website. The nastiness of a place, on the other hand, is characterized by filth and squalor: "The apartment's nastiness was captured in the flies buzzing around the kitchen trash can." You could also talk about the weather's nastiness on a bitterly cold, rainy day.