The Martian atmosphere is about 3% nitrogen. It probably had more once, but currently there is very little nitrogen on the planet. If you were to extract 100% of the nitrogen in the already very thin martian atmosphere and fix it into organics, you could potentially create about 30cm of soil. This is assuming you don't lock any of that nitrogen into plants, people, or other organic molecules (plastics, glues, etc.). Realistically, the upper limit of martian population is about 300M before 100% of the nitrogen is used up. But this is assuming that you don't terraform.
If you terraform, you do so by dumping a large quantity of additional gas into the atmosphere. Primarily, this has will be carbon dioxide and water (it is what is available if you add heat), and maybe oxygen if you spend even more energy splitting it from on of the other two. Mars, however, has very low gravity and will lose hydrogen, methane, water and oxygen to space (this is entirely independent of the magnetic field, although the lack of magnetic field may speed this process up) due to thermal escape. Basically, the gravity on Mars is too low to have an atmosphere that warm and thick without shedding it to space over time.
Unfortunately, the 3% nitrogen will also get warmer and easier to shed. If we terraform Mars, we are actually reducing its carrying capacity for life in the long term by dumping it's rarest resource into space. Sure, this process will take thousands of years, but we could easily populate to 300M by then if we conserve this resource and use it wisely.
Mars one day will have nitrogen quotas. Like: "Sorry, you can't have a baby because we don't have enough nitrogen to make their body." And the only source will be importing it from other places in the solar system, or through ridiculous things like transmutation of oxygen in particle accelerators... If we terraform, we hit this cap earlier.
Mars under domes and in tunnels should be the goal.
Extended rant: the total load bearing capacity of the solar system will also likely hinge upon nitrogen. But we'd be in Dyson swarm territory before it becomes problematic.
So... can we import nitrogen from somewhere else? Are there types of asteroids which are high in nitrogen? What about the gas giants and ice giants, and their moons? Any nitrogen there we could just... yoink?
Yes, but again, if we are doing this only to shed it into space (on a terraformed mars), then we are importing it to Mars to reduce the total load bearing capacity of the solar system in the future.
Furthermore, you have to spend the colossal amounts of energy to move atmospheres worth of nitrogen around the solar system.
There is a small irony that nitrogen is currently used as gas thrusters for rockets. We're dumping earth's nitrogen into space already, granted in very very small amounts. But harvesting the earth's atmosphere for nitrogen would be very bad in the longer term if done in bulk.
Pure N2? Probably rare. The solar system does have a shit ton of ammonia though, so thats a great source of nitrogen that can be broken down to get what we need.
I'd argue phosphorus is an even more limiting compound.
It is a regular enough mineralogical component in martian regolith. If we use the soil to grow things, we should be fine as is. Furthermore, we aren't worried about losing it into space if we terraform.
On the scale of the solar system, phosphorus may indeed end up being rare and might be one of the limiting factors for total load bearing capacity of the solar system.
As a layman I still think floating stations in Venus’ atmosphere are a much better avenue for inhabiting another planet over trying to terraform mars with magic non-existent tech. Gravity is almost that of earth’s as opposed to like 1/4th or whatever mars’ is. Id say trying to change its atmosphere would also be a worthwhile endeavor if its rotational period wasn’t so freakin long—dont think anyone wants a year long day.
Anyway. I don’t know what I’m talking about so take it with all the grains of salt.