Do NOT take your Realtor’s recommendation for a home inspector! That inspector knows they get referral business from the Realtor and subconsciously or not they may go “light” on the inspection, as they don’t want to “kill deals” and lose that Realtors business.
Get the baddest, meanest ASHI certified inspector you can find, preferably a former contractor, and have him/her tear the place apart. Go to the ASHI web site to find someone. ASHI is like the PHD of the home inspector business, they have to conform to high standards and constantly keep up on changes in the industry.
Get to know well the things that need to be fixed and know full well what you are getting into when you buy a house.