You should consider to follow standard 'sanitary' piping rules and regs. so that the fresh water system isnt 'retrograde contaminated' from the toilet/head !!!!
... and this isnt easy to do on a boat. Check valves, y valves, etc. CAN NOT do the job of protecting a fresh water system from retrograde contamination.
To do this job properly you have to 'cobble' a system that functions similarly to a household toilet .... the water system delivers to ***separate Tank*** and the separate tank delivers to the toilet ****through an 'air gap'****. The separate tank has a valve on the INLET of the fresh water to the separate tank and that valve ***IS ABOVE THE LEVEL OF THE WATER in the separate tank***. Thats the NSF and 'sanitary' regs.' for all 'toilets' in the USA where the 'supply water' is connected to POTABLE water. This PREVENTS harmful bacteria from entering 'retrograde' into the potable water supply ... bacteria moving against the normal flow of water.