Nonlocal Interaction Equations in Environments with Heterogeneities and Boundaries