As for the key signature, I am still seeing nothing about key in the pdf when I do this to remove all complexity:
$ lilypond -f pdf
the-mountain.lyGNU LilyPond 2.22.2 (running Guile 2.2)
Processing `
the-mountain.ly'
Parsing...
Interpreting music...
the-mountain.ly:2:1: warning: skipping zero-duration score
\key d \major
the-mountain.ly:2:1: warning: to suppress this, consider adding a spacer rest
\key d \major
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to `the-mountain.pdf'...
Success: compilation successfully completed