Sunan an-Nasa'i, Volume 2, Book 20, Hadith 1788 (DarusSalam) ⓘ
It was narrated from Abu Ad-Darda' who attributed it to the Prophet: "Whoever goes to his bed intending to get up and pray qiyam at night, then sleep overwhelms him until morning, will have recorded that which he intended and his sleep is a charity given to him by his Lord, the Mighty and Sublime."
أَخْبَرَنَا هَارُونُ بْنُ عَبْدِ اللَّهِ، قَالَ حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ، عَنْ زَائِدَةَ، عَنْ سُلَيْمَانَ، عَنْ حَبِيبِ بْنِ أَبِي ثَابِتٍ، عَنْ عَبْدَةَ بْنِ أَبِي لُبَابَةَ، عَنْ سُوَيْدِ بْنِ غَفَلَةَ، عَنْ أَبِي الدَّرْدَاءِ، يَبْلُغُ بِهِ النَّبِيَّ صلى الله عليه وسلم قَالَ " مَنْ أَتَى فِرَاشَهُ وَهُوَ يَنْوِي أَنْ يَقُومَ يُصَلِّي مِنَ اللَّيْلِ فَغَلَبَتْهُ عَيْنَاهُ حَتَّى أَصْبَحَ كُتِبَ لَهُ مَا نَوَى وَكَانَ نَوْمُهُ صَدَقَةً عَلَيْهِ مِنْ رَبِّهِ عَزَّ وَجَلَّ " . خَالَفَهُ سُفْيَانُ .
also referenced under: Hadith 1787 (Reference) & Book 20, Hadith 190 (In-Book)