I’ve been trying to integrate Nix installed OCaml compiler with OPAM, but:
opam installonly works when current switch is properly set up, with packages like
ocaml-configinstalled (which are missing from Nix).
opam switchcannot “adopt” existing OCaml installation. Even if I can work around it with some symlink hacks,
opam installmay fail because it needs to write to
$OCAML_PREFIX/lib(but paths in Nix store are read-only).
Is there any better workflow that does not require installing OCaml with OPAM?