This is a nice idea that @roberth requested. If we could factor our a generic `std::variant` impl as a follow-up it would be even better!
Also put proper comparison methods on `DerivedPath` and `NixStringContextElem`, which is needed for the tests but good in general.