with import <nixpkgs> {};

let
  libs = [
    autoconf
    bubblewrap
    binutils
    curl
    gcc
    libtool
    m4
    ocaml
    pkgconfig
  ];
in
stdenv.mkDerivation rec {
  name = "ocaml-env";
  buildInputs = libs;

  # configure opam with sandboxing
  shellHook = ''
    . /home/phg/.opam/opam-init/init.sh &>/dev/null || true
    export OPAM_USER_PATH_RO=/nix/store
  '';
}