Toilets and sinks that get regular use aren't a problem but a sump like mine was. The previous owner had left some malathion so I put a bit of that in there and sealed off the access. Bags of soil often come pre-charged with gnats that the adults got to while they were sitting around waiting to be sold. Most bags have little air holes in them and that's all they need or a tear in an otherwise sealed bag. Keep all dirt bags far away from the grow room. That means the kind dirt comes in too and not just your shady friends.
I happen to be a retired chemist but it's my many years of growing pot that have taught me all sorts of things like peroxide won't get rid of them. The peroxide will oxidize anything organic so when it's less than 1% it's already pretty weak. Might slow them down a bit but if used often it will also slow down your plants by oxidizing feeder roots too.
The best remedy is to get some Gnatrol or those mosquito dunks that have an effective bacteria in them targeted toward larva like gnats and mosquitoes. That stuff really works but if there is a source of new adults then it's an ongoing battle.