A note on derivation: In general, we always want the compiler to derive stuff automatically because it means less work for us. However, this is often accompanied by the cost of compile time. Therefore, we should not use fully automatic derivation but the semi-automatic variant instead. The latter will let us choose what to derive explicitly. It may even be better to generate a codec manually (complex, deeply nested models) in some circumstances.
Below is an example of deriving an Order instance using the kittens library. It uses shapeless under the hood and provides automatic and semi-automatic derivation for many type class instances from Cats like Eq, Order, Show, Functor, and so on.