Rare-earth nickelates RNiO$_2$ adopting an infinite-layer phase show superconductivity once La, Pr or Nd are substituted by a divalent cation. Either in the pristine or doped form, these materials are reported to adopt a high symmetry, perfectly symmetric, P4/mmm tetragonal cell. Nevertheless, bulk compounds are scarce, hindering a full understanding of the role of chemical pressure or strain on lattice distortions that in turn could alter magnetic and electronic properties of the 2D nickelates. Here, by performing a full analysis of the prototypical YNiO$_2$ compound with first-principles simulations, we identify that these materials are prone to exhibit O$_4$ group rotations whose type and amplitude are governed by the usual R-to-Ni cation size mismatch. We further show that these rotations can be easily tuned by external stimuli modifying lattice parameters such as pressure or strain. Finally, we reveal that H intercalation is favored for any infinite-layer nickelate member and pushes the propensity of the compounds to exhibit octahedra rotations.