Make sure you keep top soil dry, have fans pointing at the soil if needed, fungus gnats cannot fly well in the air and won't be able to live where there is constant wind.
You can also add diatomaceous earth to your top soil, silica containing ingredients are useful against gnat larva, seaweed...