Cities and towns may purchase and hold suitable lands and water and erect such aqueducts, dams, canals, buildings, machine shops, and other works and construct and lay such conduits, mains, and pipes as may be necessary to obtain and secure a supply of water and power for operating such the waterworks and electric light works.