Closed undyamon closed 11 months ago
Ok I think I finally figured this out. The OCaml tutorial doesn't mention it but it seems like dependencies needs to be defined in the dune-project
file as well. Then using buildDuneProject
instead of buildOpamProject'
automatically generates the .opam
file that the flake needs to know which dependencies to install.
Is this all there is to know on the matter?
Yep, indeed you are supposed to add your dependencies to some file that opam-nix
reads. It doesn't read any of the dune
files, since dune
is a build system and not a package manager (mostly). The way you described should work, another possibility is adding the dependency to your <project>.opam
file (if you have such).
Makes sense, thank you!
Describe the bug This might just be me being absolutely new to the OCaml scene, but I don't seem to be able to add new dependences to a dune project. For reference, I'm following the official Getting Started guide.
To Reproduce On a machine that has never seen any Ocaml software, I did the following
Then I edited
bin/dune
to includedream
as a dependency.and finally
This puts me in an environment that does not have
dream
available (dune build
fails).Expected behavior By reading this intro I was expecting the flake to be able to figure out the dependencies by looking at the project. What am I doing wrong? Did I miss something?
Environment x86_64 GNU/Linux NixOS