Foreigners, who receive a state or private pension including social security pension, government pension, employment related pension, union pension, disability pension, etc., so lifetime annuities, other lifelong benefits or a permanent income for the rest of their life from royalties or dividends of at least US$ 1000 per month or the equivalent in any other currency can apply for a permanent residency in Peru called Rentista visa.
Be aware that rental income, income generated from remote / freelance work, capital gains, interests, etc. are not considered permanent income. To fulfill the requirement you must prove that you receive at least US$ 1000 per month “indefinitely”, so for the rest of your life.
Additionally, you should know that you are not allowed to work or receive a remuneration for any kind of professional activity in Peru when living in the country on a retirement visa.