It might be possible to generate nitrogen gas with ammonia and hydrogen peroxide galvanically, but hydrogen peroxide is only available in 3% which is a pretty weak solution. But N2(g) is inert and you could use it to store your air sensitive psychadelics and compounds in the freezer by flushing the vial with the produced N2.