We used to sleep in the mosque during the time of the Messenger of Allah ﷺ, taking our afternoon naps there, and we were young men at the time.
حدثنا ابن إدريس أخبرنا عبيد الله عن نافع
كنا في زمن رسول الله ﷺ ننام في المسجد نقيل فيه ونحن شباب
Its isnad is sahih. Bukhari, Nasai, and Abu Dawud narrated it similarly, as in al-Muntaqa 814, 815, and see what follows at 5389, 5839. "Taqeel" is from qaylulah (the midday nap).