كتاب الإمارة
33  
The Book on Government
(47)
Chapter: Criticism of one who dies without having fought (in Jihad) or having thought of fighting
(47)
باب ذَمِّ مَنْ مَاتَ وَلَمْ يَغْزُ وَلَمْ يُحَدِّثْ نَفْسَهُ بِالْغَزْوِ ‏‏
Sahih Muslim 1910

It has been narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said:

One who died but did not fight in the way of Allah nor did he express any desire (or determination) for Jihad died the death of a hypocrite. 'Abdullah b. Mubarak said: We think the hadith pertained to the time of the Messenger of Allah (ﷺ).
حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ الرَّحْمَنِ بْنِ سَهْمٍ الأَنْطَاكِيُّ، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ الْمُبَارَكِ، عَنْ وُهَيْبٍ الْمَكِّيِّ، عَنْ عُمَرَ بْنِ مُحَمَّدِ بْنِ الْمُنْكَدِرِ، عَنْ سُمَىٍّ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَنْ مَاتَ وَلَمْ يَغْزُ وَلَمْ يُحَدِّثْ بِهِ نَفْسَهُ مَاتَ عَلَى شُعْبَةٍ مِنْ نِفَاقٍ ‏"‏ ‏.‏ قَالَ ابْنُ سَهْمٍ قَالَ عَبْدُ اللَّهِ بْنُ الْمُبَارَكِ فَنُرَى أَنَّ ذَلِكَ كَانَ عَلَى عَهْدِ رَسُولِ اللَّهِ صلى الله عليه وسلم ‏.‏
Reference : Sahih Muslim 1910
In-book reference : Book 33, Hadith 226
USC-MSA web (English) reference : Book 20, Hadith 4696
  (deprecated numbering scheme)