Philippians 1:20-23: "20 as it is my eager expectation and hope that I will not be at all ashamed, but that with full courage now as always Christ will be honored in my body, whether by life or by death. 21 For to me to live is Christ, and to die is gain. 22 If I am to live in the flesh, that means fruitful labor for me. Yet which I shall choose I cannot tell. 23 I am hard pressed between the two. My desire is to depart and be with Christ, for that is far better."
2 Corinthians 5:2: "For in this tent we groan, longing to put on our heavenly dwelling"
2 Corinthians 5:8: "Yes, we are of good courage, and we would rather be away from the body and at home with the Lord."
+++
The text is public domain:
1 For me to live is Jesus,To die is gain for me;So when my Savior pleases,I meet death willingly.2 For Christ, my Lord, my brother,I leave this world so dimAnd gladly seek another,Where I shall be with Him.3 My woes are nearly over,Though long and dark the road;My sin His merits cover,And I have peace with God.4 Lord, when my pow'rs are failing,My breath comes heavily,And words are unavailing,O hear my sighs to Thee.5 In my last hour, O grant meA slumber soft and still,No doubts to vex or haunt me,Safe anchored in Thy will;6 And so to Thee still cleavingWhen death shall come to me,I fall asleep believingAnd wake in heav'n with Thee!
+++
The passage from Philippians 1 is the main source of the hymn. Verse 21 is particularly evident in the first two lines of the first verse.
The two verses from 2 Corinthians 5 overlap a bit with Philippians 1:23, and all are the basis for the second verse.
+++
The line "A slumber soft and still" in the fifth verse exhibits alliteration, and since there isn't a variety of initial sounds, there's a sense of that calm and peace.