We construct a fast, transferable, general purpose, machine-learning interatomic potential suitable for largescale simulations of N-2. The potential is trained only on high quality quantum chemical molecule-molecule interactions; no condensed phase information is used. Although there are no explicit or implicit many-molecule interaction terms, the potential reproduces the experimental phase diagram including the melt curve and the molecular solid phases of nitrogen up to 10 GPa. This demonstrates that many-molecule interactions are unnecessary to explain the condensed phases of N-2. With increased pressure, transitions are observed from cubic (alpha), which optimizes quadrupole-quadrupole interactions, through tetragonal (gamma ), which allows more efficient packing, to monoclinic (lambda), which packs still more efficiently. On heating, we obtain the hcp three-dimensional (3D) rotor phase (beta) and, at pressure, the cubic delta phase which contains both 3D and 2D rotors, tetragonal delta* phase with 2D rotors, and the rhombohedral epsilon. Molecular dynamics demonstrates where these phases are indeed rotors, rather than frustrated order. The model supports the metastability of the complex iota phase, but not the reported existence of the wide range of bond lengths. The thermodynamic transitions involve both shifts of molecular centers and rotations of molecules: the onset of rotation is rapid, whereas motion of molecular centers is inhibited and we suggest that this is the cause of the experimentally observed sluggishness of transitions. Routine density functional theory calculations give a similar picture to the potential.