Create an overlay that depends on package from existing overlay?

Wondering how I can create an overlay that depends on a package from another overlay? Specifically emacs-overlay for it’s emacsWithPackagesFromUsePackage function.

I thought of importing the emacs-overlay and literally including it in my overlay, or just letting my code error if it can’t find that you’ve already installed the emacs-overlay, but I didn’t know if those were good methods, and if there is a better way.

Try final instead of prev

I get that final is supposed to be ‘nixpkgs with your overlay applied’, so if I imported the emacs-overlay and included it in my overlay, I should find its packages in final. What I’m asking is if doing that is the correct way to use a package from the emacs-overlay in my own overlay.

There’s not really any other way to use the packages from the overlay when it’s imported, so it’s correct if it works.