I've read a little bit on other magic system suggestions (not everything or I'd never get anything else done), and here are some of my thoughts.
Deities and their spheres will be the main sources of magic, with some exceptions. Each race will have its own magical aptitude and magical curiosity, specified in raws. Magical aptitude refers to how capable a creature is at learning or practicing magics, while curiosity refers to their general inclination to do so. For example, elves might have very high magical aptitude and moderate magical curiosity, dwarves might have low magical aptitude and below average curiosity, while humans have average magical aptitude, but a very high curiosity, due to their ambitious nature. Generally, this will mean humans are more likely to try to "collect" magical powers, and are more likely to explore types of magic the other races might avoid. At world gen a couple settings will control how large a part magic plays, one setting will govern the overall amount of magic present in the world, while another acts as a scaling factor for each race's aptitude. A world with high magic present and a high scaling factor = most creatures have magical powers, a world with very low magic present and a high scaling factor = very few creatures with very powerful magic powers, a world with high magic and low scaling factor = many magic type animals (dragons, unicorns, etc) but very few creatures with magical powers, a world with no magic present will be completely mundane. Magic will have several manifestations in the world:
1. Artifacts which derive their power based on the type of item, the inspiration for the item, and the materials used. Inspiration may come from a deity, in which case the spheres the deity is associated with will play a major part in determining the power. Not all artifacts will be magical, some may just be really fancy items, or created to signify some certain event. The artifacts that are not deity-inspired are more likely to be mundane.
2. Alchemy which may be used to craft potions or transmute metals. Potion-making is fairly straightforward. Combining certain herbs together in a glass vial may make a potion that can be carried by a dwarf and used in combat situations (or in every day life depending on the potion). Exotic ingredients can make powerful potions and possibly even forgotten beast extract based poisons. Transmutation is a bit difficult to nail down without making it mechanical and overpowered. Ideally, it would be used to generate some metals with exotic properties, sort of like the material-derived powers from artifacts above, or even just very good quality metals somewhere between steel and adamantine. The trouble lies in making it a worthwhile process, while at the same time preventing it from being an assembly line of exotic metals. Basic constraints might be time/material based. Something more advanced will be needed as well, otherwise you might end up with forts full of dwarves who all stop what they're doing when the calendar hits hematite, and all turn into alchemists to make runesteel, then go back to whatever they were doing before.
3. Good old fashioned spells. Spells mostly draw their power from the spheres (not every sphere though, not sure what sort of "salt" spell there would be), so there will be a bit of overlap, and a lot of variety. Not sure how an actual spellcasting system would work though. Dwarves should be autonomous enough that they are able to select and cast spells with minimal player intervention without crushing the rest of the militia under a fiery meteor, though I would leave some wiggle room in; a poorly trained and undisciplined mage may very well call a meteor strike when it is unwise to do so. Tons and tons of ways spellcasting could go, and it will be difficult to balance making spellcasting feel powerful in the hands of an adventurer, while still manageable in fortress mode. Spells could be learned through tomes/slabs, a master/apprentice relationship, research, or devotion to a deity.
4. Natural world magic. Mostly the domain of Elves, this includes things like treeshaping, passing through forests or other areas peacefully, or magical creatures like dragons, ents, or even golems.
Worldgen should include some "prehistory" generation, which doesn't have to be much more than creating a set of myths associated with deities, the world itself, civilizations, and creatures. These would be stories like Greek myths, tales of Atlantis and El Dorado, Egyptian mummies, etc. Most of them would be inspiration for poems and tavern songs and the like. Dwarven scholars would attempt to gather and scrutinize these myths and legends for indications of their existence and where they might be. When they believe they have identified a location of significance, they can send your expedition out to explore it in fortress mode, or hire your adventurer to escort them in adventure mode.
An example might be a myth that a certain deity sculpted the first dwarves out of stone from the mightiest mountain, and the other deities became jealous; one carved elves from the trees, another crafted goblins from the filthiest swamps, kobolds from the dirt of cave floors, and the most envious deity made humans from a little bit of everything. This type of creation myth probably won't have an actual impact in the game, except for possibly dwarves wanting to find the mightiest mountain and establish it as a place of pilgrimage, or to search for ruins or establish a fortress underneath.
Another example of a myth might be that the dwarves of a fortress were unfaithful to the deity of volcanoes and fire, so he sent a mighty dragon to attack. After suffering heavy casualties at the fortress, a hero slays the dragon and has the dragon scales made into a glorious fire-proof armor to commemorate the event. The deity was furious that they would be brazen enough to craft such an armor and cursed the fortress to ruins and all its inhabitants that they would all perish by fire. Several legends might come out of this, the story of the dwarves spurning the deity, the dragon sent by the gods to punish the nonbelievers, the hero's battle against the dragon and his triumph over the beast, the hero's armor, and the cursed fortress.
Through inscribing, collecting, cataloging, and studying of myths, rumors, liaison reports, and their own research, dwarves can expand their knowledge of the world, and possibly discover new spells or old relics. Implementation of this part would be up in the air, but it will probably require a new room (or zone) for the library (which could allow the player to peruse legends while in fort mode), and new professions to encompass the acts of research and the different magic abilities. New items like papyrus and ink would have to be produced to support inscription, and new reactions would have to be added to engrave slabs with more information. It could be generic enough so that in the future, you could establish a fortress-wide library that some dwarves would go to on break that could contain the legends, a mage's guild library where you can view magical discoveries and ingredients for spells/alchemy and whatnot, a miner's guild library where you can find geology information (where to find which rocks, which rocks are magma-proof, things like that), nobles could request their own private library dedicated to their greatness, and so on. Guilds would send masters to establish chapters in fortresses after they hit certain milestones (barony, county, duchy), limiting access to magic unless you choose to embark with a mage. If your fortress becomes known for its magical studies (or becomes the mountainhome), the archmage could decide to relocate the seat of the mage's guild to your fortress.
There would probably be a good bit of overlap between priests and other temple workers and the magic system professions. The priests would study all the data related to their deity and may require certain items to sacrifice, and their devoutness may be rewarded with magical instruction.
Scenario example: The mage's guild believes they have pinpointed the locations of a set of ancient ruins that may contain a certain magical artifact. You are to lead an expedition accompanied by a veteran mage and his apprentice. Upon arrival, you will establish quarters for the mage as well as a workspace where he may conduct his studies. Then you are to search for the artifact. We estimate it was lost over a thousand years ago when the nearby volcano erupted. We don't know what powers it may possess, so approach with caution.
Upon discovery of the artifact, an iron sword decorated with obsidian, a stream of undead guardians pour forth. After your militia dispatches them, you recover the artifact and the mage takes it for study, along with the slabs left behind in the ruins. The mage analyzes the artifact, and it is determined that it possesses the power to revive slain foes in service of the slayer. At the same time, the apprentice studies the slabs and finds that the previous owner was a worshipper of a certain deity, whose domain are the spheres of death and thralldom. It seems the artifact's power may only be realized in the hands of a faithful worshipper of this deity If you have a dwarf able to wield the artifact, it may prove to be useful, but the roaming undead following the owner around will surely upset other citizens in the fort. The slabs also may contain information of either magical, cultural, or historical significance, and may be able to be put to use either as recipes for new spells/potions/whatever or sold to the mountainhomes.
Interaction is different depending on fortress mode vs adventure mode. Magic will probably play more of a role in adventure mode where the player is encouraged to seek it out. An adventurer may be able to learn the secrets of many spheres, while in dwarf mode this may be quite rare. There could be things like a shack in the middle of a forest where an old mage has retired, and if you can track him down, he may teach you some powerful spells, or a witch's hut in a swamp full of rare ingredients, and things like this just won't be available in fortress mode. Interaction with deities would definitely be fleshed out more. After some time of trying to appease the deity and make sacrifices to it, then it might appear to you in a dream and try to send you on a quest, after which it will reward you. However, becoming a worshipper of one deity of a certain set of spheres would preclude you from worshipping a deity of opposing spheres. If you try to, the deity may curse you.