Usually Nix users don’t use opam. And use Nix instead for package management, environment isolation and defining OCaml projects.
Is there a specific reason you need Opam?
On the Nix way:
Nixpkgs has OCaml packages, and you reference them in your project, just as you would with any package. And then, the OCaml package will be available to your application. Usually buildDunePackage is used to build the software. See: https://nixos.org/manual/nixpkgs/unstable/index.html#sec-language-ocaml
There are many things that come packaged in nixpkgs that won’t work without configuration.
If I just put nginx in my system packages that doesn’t just set up nginx.
nixpkgs can not concern itself with configuration so that further configuration needs to be handled by modules be it nixos for system level or home-manager for user level (or by hand)