Yea the lithium-ion batteries are pretty good, you can also get 10 year smoke detectors with a built in lithium battery. Also a psa, smoke detectors usually only last 10 years and need to be replaced after that. There’s often an expiry date on the detectors.
Lithium batteries last 5-10 years, regular 9v alkaline batteries last about 12-18 months. Some sources recommend changing the batteries every 6th month but i personally think that’s a bit excessive.
I only have a small 2 room apartment so i just got myself a cheap-ish optical smoke detector with a built in lithium battery. The battery should last 10 years which is how long smoke detectors last before they should be replaced.