Cities of the second class and villages shall have power to grant a franchise, for a period of not to exceed twenty-five years, to any person, company, corporation, or association, whether publicly or privately owned, to furnish light and power to the residents, citizens, and corporations doing business in such city or village, and to make contracts, for a period of not to exceed five years, with such person, company, or association for the furnishing of light for the streets, lanes, alleys, and other public places and property of such city or village, and the inhabitants of such city or village, the furnishing of electricity to pump water or similar services for such city or village, and to levy a tax for the purpose of paying the costs of such lighting of streets, lanes, alleys, and other public places and property of such city or village. No public service company, whether publicly or privately owned, shall sell to any city of the second class or village, now generating its own electric current for all or the major portion of its electric requirements, unless first authorized so to do by a vote of the electors of such city or village, in the same manner and subject to the same conditions as are set forth in section 18-412. If no tax or issuance of bonds is required, any city of the second class or village may by resolution of the city council or village board of trustees contract for the furnishing of electricity at retail to such city or village, or to any electric plant within such city or village, with any public power district or an electric cooperative which cooperative has an approved retail service area adjoining such city or village.