Sunan Ibn Majah, Book 37, Hadith 4302 (In-Book) ⓘ
It was narrated that Harithah bin Mudarrib said: “We came to Khabbab to visit him (when he was sick), and he said: ‘I have been sick for a long time, and were it not that I heard the Messenger of Allah say: “Do not wish for death,” I would have wished for it.’ And he said: “A person will be rewarded for all his spending, except for (what he spends) on dust,” or he said, “on building.”
حَدَّثَنَا إِسْمَاعِيلُ بْنُ مُوسَى، حَدَّثَنَا شَرِيكٌ، عَنْ أَبِي إِسْحَاقَ، عَنْ حَارِثَةَ بْنِ مُضَرِّبٍ، قَالَ أَتَيْنَا خَبَّابًا نَعُودُهُ فَقَالَ لَقَدْ طَالَ سُقْمِي وَلَوْلاَ أَنِّي سَمِعْتُ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ يَقُولُ " لاَ تَتَمَنَّوُا الْمَوْتَ " . لَتَمَنَّيْتُهُ وَقَالَ " إِنَّ الْعَبْدَ لَيُؤْجَرُ فِي نَفَقَتِهِ كُلِّهَا إِلاَّ فِي التُّرَابِ " . أَوْ قَالَ " فِي الْبِنَاءِ " .
also referenced under: Hadith 4163 (Reference) & Volume 5, Book 37, Hadith 4163 (DarusSalam)