Yes, you can do that. You need to have the solo 401k set up by the end of 2015, and make the effective date January 1, 2015.
You need to have schedule C income, so it would depend on how you're classifying the house flipping income -- it's possible that can count as a capital gain rather than earned income which would have it's own advantages, but I really don't know how that works.