Nuclear de-excitation lines as a probe of low-energy cosmic rays