Thats clever and less obvious than a gun cabinet. I am not a fan of gun cabinets simply because in the event your house it ransacked when you are not there gun cabinets just beckon the thieves.
Im not a fan of headboards either. They make too much noise. That headboard could easily be anchored to the wall at head of bed. A sturdy handrail could be fastened to lower part of headboard. Cabinet is roomy enough for a jug and glasses and anything else you may require during the evening.