Without energy to matter converters or desktop controlled fusion (to create one element from another), you need to have as input every element that you want in your output.
You don't need every element - just the most common. The trace elements can be added with special "element cartridges". Based on earth's composition == most commonly used for lots of things Wikipedia list of earth's most abundant elements:
- Iron (32.1%)
- Oxygen (30.1%)
- Silicon (15.1%)
- Magnesium (13.9%)
- Sulfur (2.9%)
- Nickel (1.8%)
- Calcium (1.5%)
- Aluminum (1.4%)
That covers 98+% of the earth. Plus you need a few more elements that are biologically important Wikipedia composition of the human body
which together with the first 8 elements comprise 99+% of the human body and most of the things humans eat.
Assuming your advanced starship has nanotechnology capable of performing any reasonable chemical transformation, you just need to have your elements in an easily stored form that is also easily transportable from cargo hold to your shipwide system of replicators. This would certainly include liquids at room temperature. Water (hydrogen + oxygen) and alcohol (carbon + hydrogen + oxygen) provide some key elements on their own and both are excellent solvents for many other elements. In addition to ordinary liquids, gases (e.g., nitrogen) and possibly slurry for large amounts of silicon, iron or similar elements could be piped from the cargo hold to the replicators as well.
A handful of pipes should be sufficient:
For example, a simple saltwater solution includes hydrogen + oxygen + sodium + chlorine, and can include potassium (as potassium chloride) very easily. Additional elements can be included as long as they are mixed thoroughly so that distribution is consistent. Magnesium is a relatively significant element in Earth sea water and can be included here too.
Alcohol can dissolve many things better or more easily than water.
Noble gases can be mixed together with nitrogen as a gaseous feed. I wouldn't include hydrogen or oxygen in that pipe as they can be extracted from the water and alcohol.
Total pipes: minimum 4 (water solution; alcohol solution; slurry for silicon, iron, etc.; gas) but probably 6 - 10 total depending on combinations of elements if multiple water, alcohol or other solutions will more easily provide a useful and homogeneous (each pipe should provide a homogeneous mixture so that your nanobots don't have to wait for anything to be available) mix of elements and to avoid dangerous interactions. Plus the "trace element cartridge" installed manually as needed for gold, silver and other small (by quantity) but important elements.
Route the bundle of pipes as a group together throughout the ship - similar to running cold water + hot water or power + phone + network cables. Every replicator will have everything it needs on tap to produce tea, Early Grey, hot, a raw or cooked egg, steak and potatoes or a replacement part for the Retro Encabulator.