The Mars Science Laboratory landed in Gale crater on Mars in August 2012, and the Curiosity rover then began field studies on its drive toward Mount Sharp, a central peak made of ancient sediments. CheMin is one of ten instruments on or inside the rover, all designed to provide detailed information on the rocks, soils and atmosphere in this region. CheMin is a miniaturized X-ray diffraction/X-ray fluorescence (XRD/XRF) instrument that uses transmission geometry with an energy-discriminating CCD detector. CheMin uses onboard standards for XRD and XRF calibration, and beryl:quartz mixtures constitute the primary XRD standards. Four samples have been analysed by CheMin, namely a soil sample, two samples drilled from mudstones and a sample drilled from a sandstone. Rietveld and full-pattern analysis of the XRD data reveal a complex mineralogy, with contributions from parent igneous rocks, amorphous components and several minerals relating to aqueous alteration. In particular, the mudstone samples all contain one or more phyllosilicates consistent with alteration in liquid water. In addition to quantitative mineralogy, Rietveld refinements also provide unit-cell parameters for the major phases, which can be used to infer the chemical compositions of individual minerals and, by difference, the composition of the amorphous component.