Once you have seated the rivet, if you make the free length of shank protruding beyond the material (the part you will punch to make the head) between 1.25 and 1.5 times the diameter of the shank. That will allow you enough material to form the head. Less than 1.25 x dia is too little to form a complete hemisphere, and more than 1.5 x dia is too much, which results in the bit nearest the plate/sheet being squashed out, like a fungus at the bottom of a mushroom.
The previous advice to use the pre-formed heads on the outside is good, but not always possible.
Pliers-style manual snap tools used to be available from a chap called Dave Noble, but seem not to have been obtainable for some years. There was a good design in MEW or ME some time ago, and I think Model Engineers Laser does the laser cut parts.. The trouble is the operating head is quite large and needs to be able to fit behind the rivet. There is also an air powered tool commonly called a crocodile (or alligator?) which squeezes rivets closed, forming a flat head or a mushroom head, depending on the anvils fitted to the tool. I have one of those tools, but, again, it is usually too large or has too short a throat to fit where I want to rivet.
Marcus