They all seem okay to me, and, as far as I know, all are legally enforceable restrictions.
Here are some more -
A plot of land. In 1882 the land was sold to X, with a restriction that the land could never have a house bigger than 1000 square feet on it, and that if sold, the land must be sold with the same restriction. X sold it to Y. Y sold it to Z. Z sold it to W. W sold it to me. Is it "fair" for the restriction to apply to me?
I leave you my property in my will, on the condition that you marry by age 23, otherwise the property goes to my friend Bob. Is that ok?
I donate money to a university, on the condition that it only be used to teach swimming classes. Is that ok?