Looking at the text of detect magic It gives us the following, my emphasis:
Through time, you feel the presence of magic 30 feet away from you. If you feel magic in this way, you can use your action to see a weak aura around any creature or object visible in the area that takes magic, and you learn your school of magic, if there is one. […]
What this means is that detect magic it only allows the magic school being used to determine whether the target is visible, be it a creature or an object.
This may mean that while presence of magic is detected (due to detect magic not specifying that it detects the magic that is affecting objects or creatures specifically), the type of magic is not (since that would point to a creature or object). Anything else will go beyond a strict RAW resolution, which I can not answer.
It may be useful to look at this post about detect magic and illusions.