Minor nitpick: There are only very few plants that are able to extract nitrogen from the air. That's because N2 is a very stable molecule and it takes a lot of energy to use it chemically. Almost all plants are dependent on other nitrogen compounds they extract using their roots.
[That's the reason why the invention of the Haber-Bosch process, which fixes the N2 from the air into NH3 (ammonia), was such a big deal. It is estimated that 50% of the nitrogen atoms in your body once passed through the Haber-Bosch process.]
There's probably plenty of nitrogen in various minerals on Mars. Just not in the atmosphere.
So you would NOT want to colonize a planet first and then terraform it. Instead you would terraform it first. Terraforming Mars for example could involve sending a large number of comets to crash to the planet. If there were existing colonies on the planet, they might be destroyed by the impacts or be inundated by the torrential rains.
Isaac Arthur has some thought provoking videos about this.