In a private civil action for an alleged nuisance related to agricultural activities conducted at a concentrated animal feeding facility, it is an affirmative defense if the person owning, operating, or otherwise responsible for the concentrated animal feeding facility is in compliance with best management practices established in the installation permit or permit to operate issued for the concentrated animal feeding facility and the agricultural activities do not violate federal, state, and local laws governing nuisances.