It is commonly admitted that the continuous development of human infrastructure (HI), resulting in natural habitat fragmentation, affects farmland birds by misleading their strategies of nest site selection. Here, we examined how HI in agricultural landscape (AL) could be affecting nest habitat selection of Barbary partridge (BP; Alectoris barbara). A total of 160 BP nests were monitored during 4 years (2017, 2018, 2021, and 2022) in eight Moroccan agricultural zones. We used the generalized linear mixed models and variation partitioning methods to quantify the effects of AL and HI on BP nest occurrence. This occurrence increased with track density (within 300 m of sampled nests) and decreased with built‐up area cover (50 m). Nest occurrence was also associated with the cover of agricultural areas (300 m), distances to the nearest agricultural area, the nearest human settlement, and the nearest track. However, the effect of these covariates depended on distance to the nearest paved road, being close to roads located far away from agricultural areas and tracks and near human settlements and tracks. Overall, our results highlighted a trend to nest close to HI when agricultural areas were relatively remote or less represented. For the effective conservation and management of the Moroccan BP populations, it is critical to keep human infrastructures at a level that allows for maintaining the relative dominance of the agricultural landscape. Further fragmentation of this landscape will impact the ability of this farmland species to select its nesting sites flexibly.