Combined crossed-beam and theoretical investigation on the reactions of formation of nitriles in extraterrestrial environments