Many years ago I had a mallard nest on open moorland about 600' a.s.l. and no water within several miles.
More recently, in Portugal, we had a river as the boundary not far below the house. Mallards, maybe half a ozen a year, nested in thickets within probably about 20 yard of the river...