Skip to content

Instantly share code, notes, and snippets.

@kevgathuku
Last active June 24, 2025 19:40
Show Gist options
  • Save kevgathuku/57b990b42713a9be9cb3b81d819dcab8 to your computer and use it in GitHub Desktop.
Save kevgathuku/57b990b42713a9be9cb3b81d819dcab8 to your computer and use it in GitHub Desktop.

Ensure the dune-project file has the generate opam file directive

(generate_opam_files true)

Any dune command call will generate the .opam file

And the deps specified can be installed with opam

❯ opam install --deps-only --with-test .

Using direnv + opam via the following .envrc

export OPAMSWITCH="$HOME/path/to/opam/switch"
eval $(opam env)

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment