Deductions & credits

I just want to double check something for my already filed 2023 tax return. I took the insurance and traditional 401k contribution deductions, which equal my total net profit. I put an additional $8k into a traditional IRA. So what you are saying is that that is not allowed unless I have other income? In fact, my wife had additional income from her employment, so I think I'm good for this year. If she stops working, does that mean the total for my wife's and my contribution to all of our traditional IRAs and 401ks can't exceed my net profit?