Diatomaceous Earth is decent stuff, but understand that it only bugs the bugs when it is bone dry. Putting it on top of your soil will not help.
IMO, a combination of Mosquito Dunks (
Bacillus thuringiensis subspecies
israelensis (Bti)) and sticky panels is the most effective solution for gnats, those and keeping the surface of your soil as dry as feasible given your fertigation/irrigation setup. Others here have also used electronic zappers - adult gnats are apparently attracted to the blue light. I buy the stickies as largish sheets off Amazon, the little ones at the garden supply places are stupid expensive by comparison. For me, the best way to use the dunks is to break one up in your watering can and leave it in there in water for a day before watering. Add more water to the residual (it will last for multiple waterings) after using some so that it gets to sit for hours before applying it. Give it a good stir or shake before watering, and it is really bad news for gnat larvae.
Going with a prepared soil that is highly reviewed here should get you through a grow nicely, and so will a grow with MegaCrop. I recommend the two part MC, and your best source may be online.
@Mañ'O'Green has worked up a schedule specifically for MC 2 part and autos. You will need to have a pH meter and an EC/PPM meter. Don't go cheap on the pH meter, but any calibratable EC meter will do the job. I recommend an Apera PH60 for pH, and this cheapie for EC/PPM:
TDS Meter Digital Water Tester - 3 in 1 ppm EC and Temperature Test Pen | Easy to Use Water Purity Tester | Ideal for Testing RO Drinking Water Swimming Pool Hydroponics Aquarium & More | White : Amazon.ca: Industrial & Scientific
If you go with Megacrop, using coco medium would be my choice, and if you do that, make sure that you study CocoforCannabis.com first.
Once again, if you use the DE to kill gnats, you will have to apply it so that it stays dry, and locate it where the adults will contact it. On or in the soil is no good - putting it there might add a bit of silica, but it will do bugger all to control gnats. Stickies are IMO better for killing adults in our grows.
Good luck with it.