Well, It's Almost Chanukah… Where Does a Yeshivah Bachur Light Candles?
— Eruvin 73a
תלמוד בבלי מסכת עירובין דף עג/א
בעא מיניה רב חייא בר אבין מרב ששת בני בי רב דאכלי נהמא בבאגא ואתו ובייתי בבי רב כי משחינן להו תחומא מבי רב משחינן להו או מבאגא משחינן להו אמר ליה משחינן מבי רב
The Gemara here relates a question that R' Chiya bar Avin asked R' Sheishes: Talmidim in a yeshivah that eat their meals in an inn in a valley but sleep in the yeshivah, from where are their 2000 amos of Techum Shabbos measured? Rav Sheishes responded that the Techum is measured from the yeshivah — i.e., from the place in which they sleep (see Shulchan Aruch, Orach Chaim 409:7). The Gemara subsequently explains that this is because, given the possibility, they would prefer to eat in the yeshivah.
The Gemara here equates eruvei chatzeiros with eruvei techumin, and on this basis the Magen Avraham (370:5) rules that a shepherd who eats his meals in town, but sleeps out in the field, does not have to be included in the town's eruvei chatzeiros — since his primary place is in the field (see Pri Megadim and Beur Halachah ad loc.).
Teshuvos Minchas Yitzchak (; citing Moadim U'Zemanim 6:88) notes that the Taz (677:2) equates the parameters of eruvei chatzeiros and Chanukah. Hence, it is preferable for talmidim in a yeshivah to light the Chanukah candles in their dormitories, rather than in the dining room.
The Minchas Yitzchak does qualify his ruling: If the talmidim sleep at home and eat in the yeshivah, it cannot be said that, given the opportunity, they would prefer to eat at home — since going home might lead to Bittul Torah! Therefore, they should arrange to eat at home during Chanukah, so that they definitely may light candles there. However, if this might indeed lead to Bittul Torah, they should in fact light in the yeshivah's dining room (see also Teshuvos Mishneh Halachos 11:538).