Both argon and nitrogen are usually produced on Earth by freezing a volume of air until it liquefies, and then separating its component chemicals by carefully adjusting the temperature so that each one boils off separately and is collected. This is very energy intensive. The lower temperatures on Mars would mitigate this to some extent, but on the other hand, Mars experiences big temperature swings between day and night. That would probably make temperatures much harder to control in the precise manner needed.
More recently, pressure swing adsorption has begun to be used for producing nitrogen, and for sequestration of carbon dioxide. This works by pumping air through a high-pressure chamber filled with adsorption material like activated carbon or zeolites. There are synthetic zeolites that selectively absorb nitrogen. The quote below is from this link, from the New Zealand Institute of Chemistry:
Zeolites are aluminosilicate minerals with complex crystal structures
made up of interlocking rings of silicon, aluminium and oxygen ions.
The chemical composition of the zeolite used for oxygen separation is
Na12[(AlO2)12((SiO2)12].27H2O. It is the zeolite’s shape which
provides most of the ability to selectively adsorb nitrogen. The
zeolite used for oxygen production is shaped like a die with holes
drilled on each face to form an internal cage. The corners of the die
(providing the framework) are SiO2 and AlO2 units. Cations (either Na
or Ca) are exposed throughout the crystal lattice. This zeolite is
shown in Figure 1.
(It is sometimes used for oxygen production on Earth because removing atmospheric nitrogen leaves mostly oxygen.) The air that exits such a pressure chamber is stripped of some of its nitrogen. Once the zeolite has been fully charged in this way with nitrogen, the pressure in the chamber is reduced, and the nitrogen naturally releases again as a gas, and can be collected. Over several passes, the concentration of nitrogen in the resulting gas is increased, it can in very refined systems be made of high purity.
But for Mars, maybe something like 90% would be enough, in the interest of reducing system power needs, size, and mass that needs to be launched from Earth. The effectiveness of the system depends on how good the zeolites are. In some ways, this is a good thing. They wouldn't have any trouble surviving the rigors of launch and landing, and they work passively, meaning they don't need repairs and maintenance. They can be used over and over, just release the pressure, and they release their nitrogen, then they are ready to adsorb more. On the other hand, they are heavy. I can't find figures so far on how much nitrogen you can expect to get from each cycle from each kilogram of zeolite (density of about $0.7 gm/cm^3$), but they are like porous rock. I bet it isn't much. Perhaps the technique that has been proposed for other resources, of sending ahead an automated plant that will run on its own, storing up nitrogen while it awaits the arrival of the first crew, could work. The mechanical parts in the system are pretty simple - pumps and pressure chambers. It sounds like something that could reasonably be automated, and the hardware parts aren't difficult to repair or replace.
At least the power needs of the system, compared to cryogenic separation, are much lower. Which is a whole other can of worms - how many nuclear thermal generators a crewed base would need, and whether a solar power system could be an effective substitute. At any rate, much of the mass you would have to ship in zeolite could be defended by counting up the mass of power generators, insulators, and heat exchangers you wouldn't need to ship because a cryogenic system isn't being used. This table from the same article linked above, by NZIC, makes clear how much less power PSA requires: