powering a nikon d40 from an ac outlet

I have been shooting a lot of time lapses lately. The biggest problem with that is battery life. I have a very ghetto hack to power the camera from a cell phone charger, but I am looking for a more permanent solution. I found a fotodiox battery grip on amazon that has an internal battery, …