A probably easier to maintain alternative would be having a separate
branch “attic” with only those archived parts of the source tree.
That way, history is maintained, but the code won’t get installed
anywhere and also not be part of the source dist.