There was an article recently in Backyard Poultry about a chicken / composting operation here in Montpelier Vermont, where the owner raises about 1,200 chickens and doesn't buy feed. He does it by letting them free range on a giant compost pile, where they get to eat various compost veggies as well as bugs & worms in the compost pile. He collects the compostables from the local restaurants (they pay him to take it). Individual residents can also contract with a small business that takes compost in 5-gal buckets up to this compost operation. There are "rules" that the composters have to follow - like no chicken in the compost contributions.
This has recently been controversial, locally, because some state agencies think this guy needs a development permit for his "solid waste processing facility" whereas others feel that this is an agricultural operation which is exempt from the permitting process (obviously it is agricultural, but there's some legal technicalities).
As my own chicks are only 15 weeks old, I still buy eggs. Vermont Compost Company eggs are the best!
At my own scale, I have been trying to figure out how to do this without attracting predators. Imagine combining the deep litter method with your compost pile. VT Compost Co. has dogs that go out at night to ward off predators, and perhaps some other precautions, too.
I have also been wondering - it seems like today the "layer" feed is designed to optimize egg production. By not buying feed, the mix of protein, etc. may not be exactly optimal -- a hundred years ago, the expectations for egg production were probably a little lower. If you give chickens mostly veggie scraps, it seems like the biggest challenge is enough protein. In the summer, it is easy to give them corn on the cob (after you eat it; they vacuum the cob clean).