Mishkat al-Masabih 699
وَعَنْ أَبِي مُوسَى الْأَشْعَرِيِّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَعْظَمُ النَّاسِ أَجْرًا فِي الصَّلَاةِ أَبْعَدُهُمْ فَأَبْعَدُهُمْ مَمْشًى وَالَّذِي يَنْتَظِرُ الصَّلَاةَ حَتَّى يُصَلِّيَهَا مَعَ الْإِمَامِ أَعْظَمُ أجرا من الَّذِي يُصَلِّي ثمَّ ينَام»
And from Abu Musa al-Ashʿari, who said: The Messenger of Allah ﷺ said: "The people with the greatest reward for the prayer are those who walk the farthest, and then the next farthest. And the one who waits for the prayer until he prays it with the imam has a greater reward than the one who prays and then sleeps."