One thing I found useful was to add ground cinnamon to the soil. I heard this helps discourage them by killing off their food source because it contains cinnamaldehyde
Other things I've found useful are mosquito bits (tremendous) and citronella in different forms. Used as an essential oil, add it to a bowl of water near a heater and let the vapour surrounf your plants, gnats hate it, and it smells nice.