The nuclear dependence of charm hadroproduction