opam-nixTurn opam-based OCaml projects into Nix derivations, automatically resolving both OCaml and system dependencies.
opam-nix can build packages
opam and dune-project files,It also comes with the power of Nix, allowing you to effortlessly manage multiple projects with different dependency versions, override dependencies, cache builds, and more.
For a quick introduction to opam-nix and a guide to get you started, read this blog post on the Tweag blog.
opam-nix comes with some templates that can help you package opam packages with Nix.
Note
All of these templates assume that you already have an OCaml project packaged with opam, and just want to package it with Nix. If you're starting from scratch, you have to set up the opam files separately. The easiest way to do this is by running
nix-shell -p dune_3 --run "dune init project <project_name> ."
nix flake init -t github:tweag/opam-nixnix flake init -t github:tweag/opam-nix#executablenix flake init -t github:tweag/opam-nix#multi-packageNote
If you're using Git, you should
git add flake.nixafter initializing, as Nix operates on the git index contents.
There are also some examples which can give you some ideas of what is possible with opam-nix:
All examples are checks and packages, so you can do e.g. nix build github:tweag/opam-nix#opam-ed to try them out individually, or nix flake check github:tweag/opam-nix to build them all.
opam-nix provides all packages from opam-repository in its legacyPackages flake output.
You can use this to quickly check out some package, or get a shell with particular version without messing with opam switches.
For example:
nix build 'github:tweag/opam-nix#utop."2.10.0"' to build a specific version of utop (available in ./result),nix shell github:tweag/opam-nix#camyll.latest to get a shell with the latest version of camyll.Complete documentation for opam-nix is available in the DOCUMENTATION.md file.
You can reach out to us via the Discussions page or directly to the maintainer via email.
Nix
99.5%
opam-nixTurn opam-based OCaml projects into Nix derivations, automatically resolving both OCaml and system dependencies.
opam-nix can build packages
opam and dune-project files,It also comes with the power of Nix, allowing you to effortlessly manage multiple projects with different dependency versions, override dependencies, cache builds, and more.
For a quick introduction to opam-nix and a guide to get you started, read this blog post on the Tweag blog.
opam-nix comes with some templates that can help you package opam packages with Nix.
Note
All of these templates assume that you already have an OCaml project packaged with opam, and just want to package it with Nix. If you're starting from scratch, you have to set up the opam files separately. The easiest way to do this is by running
nix-shell -p dune_3 --run "dune init project <project_name> ."
nix flake init -t github:tweag/opam-nixnix flake init -t github:tweag/opam-nix#executablenix flake init -t github:tweag/opam-nix#multi-packageNote
If you're using Git, you should
git add flake.nixafter initializing, as Nix operates on the git index contents.
There are also some examples which can give you some ideas of what is possible with opam-nix:
All examples are checks and packages, so you can do e.g. nix build github:tweag/opam-nix#opam-ed to try them out individually, or nix flake check github:tweag/opam-nix to build them all.
opam-nix provides all packages from opam-repository in its legacyPackages flake output.
You can use this to quickly check out some package, or get a shell with particular version without messing with opam switches.
For example:
nix build 'github:tweag/opam-nix#utop."2.10.0"' to build a specific version of utop (available in ./result),nix shell github:tweag/opam-nix#camyll.latest to get a shell with the latest version of camyll.Complete documentation for opam-nix is available in the DOCUMENTATION.md file.
You can reach out to us via the Discussions page or directly to the maintainer via email.
Nix
99.5%