I answered my own question: create an invisible context with remove-layer = 3. For anyone curious:
\version "2.24.0"
\layout {
\context {
\name "NullStaff"
\type "Engraver_group"
\consists Axis_group_engraver
\override VerticalAxisGroup.staff-affinity = #DOWN
}
\context {
\Score
\accepts NullStaff
}
\context {
\StaffGroup
\consists Keep_alive_together_engraver
}
}
restsAlive = #'(stem-interface
note-head-interface
rest-interface
)
I = {
\tag #'individual \unset Staff.keepAliveInterfaces
e'1
\break
\tag #'individual \set Staff.keepAliveInterfaces = #'()
e'1
\break
R1^"show rests in the combined staff for normal systems"
\tag #'combined \set Staff.keepAliveInterfaces = #'()
% When rests are set to "worth living" don't put these changes on the system break
% This is due to a bug when an MMR is before or after the break
R1
\break
R1
\break
R1
\tag #'combined \set Staff.keepAliveInterfaces = \restsAlive
R1
}
II = {
c'1
c'1
R1
R1*2
R1*2
}
<<
\new Staff { g'1 g'1 g'1 g'1 g'1^"hide the combined staff for crowded systems" g'1 g'1 }
\new StaffGroup <<
\new NullStaff \with {
\override VerticalAxisGroup.remove-layer = 3
} { s1*5 }
\new Staff = "1+2" \with {
instrumentName = "1 2"
shortInstrumentName = "1 2"
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 2
keepAliveInterfaces = \restsAlive
} \removeWithTag #'individual << \partCombine \I \II >>
\new Staff = "1" \with {
instrumentName = "1"
shortInstrumentName = "1"
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1
keepAliveInterfaces = #'()
} \removeWithTag #'combined \I
\new Staff = "2" \with {
instrumentName = "2"
shortInstrumentName = "2"
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
\override VerticalAxisGroup.remove-layer = 1
keepAliveInterfaces = #'()
} \removeWithTag #'combined \II
>>
\new Staff { \clef bass c1 c1 c1 c1 c1 c1 c1 }
>>