Generic extension method for NullIf() supporting nullable and non-nullable value types
Just a couple of observations:

Neither Comparer&lt;T&gt; nor IComparer&lt;T&gt; pose any type restrictions on T. So I don't see any need for imposing an IComparable restriction in the implementation.
The other option would be to keep the IComparable restriction and make actually use of that interface (i.e. return value.CompareTo(equalsThis) == 0)

IComparable is the wrong abstraction to use. IComparable is meant for objects to provide a sort order as it has the concept of smaller, equal and greater. For your purposes you simply want to test for equality - so you should use IEquatable&lt;T&gt; or EqualityComparer&lt;T&gt; instead.


Update:
Turns out that enums generally don't implement IEquatable&lt;T&gt;. The best option in that case would probably be to allow the user to optionally pass in an IEqualityComparer&lt;T&gt; defaulting to EqualityComparer&lt;T&gt;.Default and again not impose any additional type restrictions.