Just make the system leaky?
So the tank gets used up to replace the stuff in your capsule as it leaks out and gets absorbed by the ship's filters.
When the tank runs out, the remaining gas leaks away, and you're left with the a nice nitrogen/oxy atmosphere.
PS:
Hehe, everything is better leaky!
