If the settlement is in the middle of a flat sheet of rock, or even has a very thin, potentially nutrient poor soil layer on top, it would be difficult to grow crops conventionally. But layer gardening is actually the answer to such a problem in our world, as it requires no digging (granted it's usually less sheet-of-rock and more layer of asphalt or concrete here, but the principles remain).
So, to make it work... the principle is to layer organic waste on top of the rock, wet it down and let it rot for a bit, and then plant seeds in the soil that creates. The organic matter will compost, helped by the plants growing, and so by the end of the year one should have turned the layer of organic waste into a layer of composted soil. This can be layered on top of in successive years for a deeper garden. Depending on weather, geography, and crops being grown, it may make sense to build raised beds which take more soil per area but hold the soil deeper for plants with longer roots, or to spread it out for more surface area for plants with shallower roots - or even a mix.
A city produces a fair amount of organic waste - food scraps and sewage, but also things like paper or cardboard, scraps of cloth or rope (well, not plastics, biodegradable), building materials like wood, and even inert materials like stone or concrete, pulverized into a sand-like stuff, can add extra depth and/or minerals. It helps to layer different kinds of waste, green leaf clippings vs paper or twigs vs manure, to ensure a good mix of nutrients.
Composting the safer materials, food scraps and paper, garden waste, cloth, etc can be grown on pretty quick - maybe a few weeks. Other materials, like sewage, may be a health hazard when fresh - though composting for some time (a year or so for human waste, I heard) should leave it relatively safe to use as soil or fertilizer.
So, the city may have to live off of stored or imported food for a few years at the beginning (depending on how much organic waste they have on hand), but each year they could dump the waste out to compost, someplace far enough to keep the smell and health risks at bay and close enough to work once it's composted, and go back a year later to garden the new soil.
The advantages are the new compost should be pretty rich, and the organic waste is not only constantly produced, but something they would have to deal with anyway. Each year they would expand their fields or deepen the soil till they have enough arable land for the city to be self-sufficient. And even if it took years to reach that point, well, each year they will have more arable soil and thus will need less imported, finding alternate sources of food and ways to get rid of the waste had to be planned anyway, so it doesn't cost them much effort and the long term gains will be sizable.