Closed rgrinberg closed 2 years ago
If you can come up with some good examples, I can package them and add them as examples. However, it's typically not much different from a single-package project. For an external example, see here: https://github.com/serokell/tezos-packaging/blob/master/nix/build/ocaml-overlay.nix#L12 . Although it's slightly complicated for some other reasons, the gist of it is just calling buildOpamProject'
and then choosing the packages you need from the resutling scope.
One good example would be https://github.com/ocaml/ocaml-lsp. A project that contains both binaries and libraries.
Thanks!
I finally took a look at the example, and I'm wondering why it uses fetchFromGithub? The other examples just assume the source is from the flake itself as one would expect
It's to avoid adding an extra flake input to all the transitive dependencies of opam-nix.
Okay. But why isn't that a problem for the other examples?
By the way, I tried the flake and it only builds the binary ocaml-lsp-server
. It doesn't build any of the libraries from the jsonrpc and lsp packages.
Lots of OCaml projects contain more than one opam package per project. But as far as I can tell, all the examples cover projects with only a single opam package. It would be good to include an example of this common project type as well.