according to the rules it is affected…
but a creature with Devil Sight can
I quoted all the rules. What rule says that an Imp can see through the Darkness spell. It only says it can see through magical darkness, which is more generic than the specific wording in the Darkness spell.
PHB 2014 says:
Specific Beats General
This book contains rules, especially in parts 2 and 3, that govern how the game plays. That said, many racial traits, class features, spells, magic items, monster abilities, and other game elements break the general rules in some way, creating an exception to how the rest of the game works. Remember this: If a specific rule contradicts a general rule, the specific rule wins.
Exceptions to the rules are often minor. For instance, many adventurers don't have proficiency with longbows, but every wood elf does because of a racial trait. That trait creates a minor exception in the game. Other examples of rule-breaking are more conspicuous. For instance, an adventurer can't normally pass through walls, but some spells make that possible. Magic accounts for most of the major exceptions to the rules.
and 2024 version words it this way:
Exceptions Supersede General Rules
General rules govern each part of the game. For example, the combat rules tell you that melee attacks use strength and ranged attacks use Dexterity. That's a general rule, and a general rule is in effect as long as something in the game doesn't explicitly say otherwise.
The game also includes elements--class features, feats, weapon properties, spells, magic items, monster abilities, and the like--that sometimes contradict a general rule. When an exception and a general rule disagree, the exception wins. For example, if a feature says you can make melee attacks using your charisma, you can do so, even though that statement disagrees with the general rule.
So a creature with Devil's Sight generally can see through magical darkness with darkvision. (affecting multiple spells that create darkness)
Specifically the Darkness spell states darkvision cannot see through
this darkness. (affecting only a single spell's darkness effect)
What 'according to the rules' says otherwise?