Ravnica background, dragonmarked race (these both add to your spell list so just pick the one with the greatest number of non wizard spells that you like), wizard at least to 17. Take as many of the spell granting feats as you can (Fey/Shadow Touched, Adept of the Black/Red/White Robes, Strixhaven Initiate, Magic Initiate, Ritual Caster). If your DM allows Theurgy than great but it's an unreleased UA so I wouldn't count on it. I'd probably do Cleric 1 Wizard x because than you can use scrolls and cleric specific staves and other items, in addition to having 1st level cleric spells and a few more cantrips (plus armor and a shield which is always nice).

I'm not sure what you think you would be getting from 5 levels of Tomelock, the book of ancient secrets and a few extra cantrips is nice but a far cry from having all the high level wizard spells.