The environmental control of sedimentary iron minerals