The water–energy–food nexus has captured the attention of many researchers and policy makers for the potential synergies between those sectors, including the development of self-sustainable solutions for agriculture systems. This paper poses a novel design approach aimed at balancing the trade-off between the computational burden and accuracy of the results. The method is based on the combination of static energy hub models of the system components and rule-based control to simulate the operational costs over a one-year period as well as a global optimization algorithm that provides, from those results, a design that maximizes the solar energy contribution. The presented real-world case study is based on an isolated greenhouse, whose water needs are met due to a desalination facility, both acting as heat consumers, as well as a solar thermal field and a biomass boiler that cover the demand. Considering the Almerian climate and 1 ha of tomato crops with two growing seasons, the optimal design parameters were determined to be (with a solar fraction of 16% and a biomass fraction of 84%): 266 m2 for the incident area of the solar field, 425 kWh for the thermal storage system, and 4234 kW for the biomass-generated power. The Levelized Cost of Heat (LCOH) values obtained for the solar field and biomass boiler were 0.035 and 0.078 /kWh, respectively, and the discounted payback period also confirmed the profitability of the plant for fuel prices over 0.05 /kWh. Thus, the proposed algorithm is useful as an innovative decision-making tool for farmers, for whom the burden of transitioning to sustainable farming systems might increase in the near future.