I sprinkle DE inside the coop and the nesting boxes; in the pine shavings, on the roosts, etc and the flys are not a problem in there at all.
I do have issues with them out in the run, so I spray down that area every day, making sure to hit all the poop spots really good. No poop = no flys. The chickens love when I spray, they wait till I'm done then come in for a good drink in the puddles & dig around looking for worms. Sadly with the heat, there are none, but they are still keeping busy which is good all around.
I swear by the DE even tho other's say it doesn't work. When I have neglected the inside of the coop & flys start coming in, I scrape the roosts, sprinkle DE all over and the flys disappear.
I have never had issues with flys in the layer feed unless someone pooped in it.
I also add it to their scratch or treats occasionally to help with internal parasites