While it's estimated more than 165,000 attendees walked through the convention centers, ballrooms and casinos at the Consumer Electronics Show in Las Vegas last week, very few likely gave a thought to a growing source of energy that has been powering the city’s streetlights, offices and some of its casinos.

That would, of course, be solar power, an abundant and increasingly cheap source of electricity in sun-drenched Nevada, a state which also has abundant geothermal energy. A few weeks ago, the city of Las Vegas said that all of its government buildings (142 of them), parks, public lights and fire stations are now being powered by clean energy.

In an interview with Greentech Media, Las Vegas Chief Sustainability Officer Tom Perrigo explained that all of the government buildings and assets -- including 45,000 streetlights and 200,000 square feet of buildings -- consume about 20 megawatts of load. A big chunk of energy is now coming from a 100-megawatt solar panel farm called Boulder Solar I, which was turned on by the state’s utility NV Energy in recent weeks.

So, no, the entire city of Las Vegas, including residential homes and commercial buildings, isn’t being powered by the sun, despite some hyperventilating blog posts that popped up around the internet in December. But Perrigo says that he thinks that Las Vegas -- yes, the entirety of Sin City -- could one day be powered by solar and clean energy, given the current low cost of solar panels.

“We realized early on we can talk about it [powering the city with clean energy] all we want, but until we did something as a city entity, we wouldn’t have a leg to stand on,” said Perrigo. “We have some work to do,” he added.

Currently, about a quarter of NV Energy’s electricity is being generated by clean energy, including solar, geothermal, hydro and a bit of wind. The rest of the state’s energy largely comes from natural gas, while coal is being phased out over the next couple of years.

However, the city of Las Vegas, and Perrigo, have been working on the transition for almost a decade now. Back in 2006, former Las Vegas Mayor Oscar Goodman was among a group of mayors to sign the climate protection agreement, beginning the process of committing the city to lower its greenhouse gas emissions by 70 percent below the levels of 1990.

The fastest way to that commitment was through clean energy and energy efficiency. First Perrigo focused on reducing the city government’s energy usage, by replacing streetlights with LEDs, and retrofitting older buildings.

Perrigo also wanted to embrace solar, but back in 2008 solar panels were much more expensive. A project to put solar panels on covered parking at community centers and parks cost about four times what it would today, said Perrigo.

But to make the solar investment more attractive, the city bundled the energy-efficiency projects with the solar ones, and tapped into some federal grants, utility rebates and other financing programs like bonds. The city has now invested in about 6 megawatts of solar panels installed on buildings, and also buys solar power from NV Energy, which can sell solar energy for under 4 cents a kilowatt-hour.

The city government is just one Las Vegas entity that’s realized a transition to solar makes economic sense. Major casino and resort companies MGM Resorts and Wynn Las Vegas have defected from NV Energy (after paying fees) and are now buying electricity from a third party.

MGM, which owns many properties in Las Vegas, has about 171 megawatts of load and is working on lowering its energy needs, as well as adding more solar. The company installed one of the largest rooftop solar panel projects (6 megawatts) on the roof of the Mandalay Bay convention center, and the panels provide about a quarter of that facility’s energy load.

Last week under the bright lights of the Mandalay Bay convention center, thousands of tech industry execs and members of the media roamed around the sprawling building, attending press conferences, checking out the latest gadgets, and dining in the restaurants. Little known to most of the attendees, solar-powered electricity -- the future of energy in Las Vegas -- was shining down on them, helping them learn about the future of consumer technology.