Non-profits can own investments of almost any kind, and earn from investments of almost any kind.

The non-profit has several options:

1) You can donate the cash to the non-profit and the non-profit can buy the house and sit on it, or attempt to earn rent from it.

2) You can buy the house and donate it to the non-profit, and the non-profit can also attempt to earn rent from it.

In general, number 2 can become more favorable for an expanded range of assets because the jeopardizing investments regulation does not apply to donated investments, only investments that were subsequently bought by the non-profit.

By the way, why are you worried about how much you donate to a non-profit? The amount you donate rolls over into future years for up to five years, charitable deductions have roll overs. This is not a factor unless you just want to keep your money longer. But this still seems to not be a factor because either entity (yourself or the non-profit) can own the house for investment.