Cut back a little on your water. I use a hydro system, but even in soil, too much moisture on top will make the gnats thrive. I inserted my feed tubes about 1/3 of the way down the pots, leaving the top couple of inches virtually dry, and the gnat problem vanished like a virgin on prom night.