Room Shocker, you can get it on Amazon. It’s worked on cat pee and skunk, I’m sure it would also work on smoke smell.
As far as the carpet, I feel for you. I had my last tenants paint over my laminate kitchen cabinets, baby blue and purple. Those things would have lasted forever. How I wanted to remodel and charge them the full cost! But I didn’t, because I’m a sucker. Not too much though as I had them professionally painted to a normal color, which was not cheap.
Maybe you could have your carpet super cleaned so it’d last a few more years, then get laminate?