For a long while all of my ROMs/devices synced contacts and calendar with /e/ using DAVx5 (which /e/'s Account Manager is based on). That part should be easy peasy.
Email also using any client of your choice.
One of the listed HOWTOs will show you how to use NextCloud to access or sync other items like documents and photos.
All of the above is covered by one or more of the tutorials in the above link.
Even on my Pinephone running Sailfish OS there is an app (forgot the name just now) allowing me to sync everything to the phone. Not bad.