They would be fine together, however, a 12g tank is going to be torture on the cleaner shrimp. Its antenna will easily reach from end to end of your tank. Id suggest holding off on the cleaner in such a small tank just for the sake of practicality.
Also, on that note, if you do a pistol/goby pair in such a small tank, realize you will only get away with 1 more fish, maybe 2 smaller ones that will stay small in a 12 gallon tank that realistically holds 8-9 actual gallons of water. Also realize you need to set up some sort of natural / artificial burrow for the pistol and goby to live in. It will be better to at least try and set it up beforehand in an area you will easily be able to view, yet still have enough cover they will feel safe in it. Leaving it to nature for them to build their own burrow, murphys law says they will build it in the most inconvenient place in the tank for you to view them do their thing. And also, please research which gobies pair with which pistols and be sure to buy two that pair in nature, DO NOT just take the fish stores word for it unless you buy them already paired from the store and have seen for yourself that they are living together. Many people have just gone out, bought a pistol and a goby, then complain later they wont bond. Just cautionary words for thought about your nano, since I too have one (a 14g biocube that the fiancee now takes care of) and have already gone thru all these stocking options when i first started that nano tank.