Skip to content

Instantly share code, notes, and snippets.

@jethrokuan
Last active December 4, 2018 06:20
Show Gist options
  • Save jethrokuan/6b6b0f6d83b29749fecdd3c3fb55a363 to your computer and use it in GitHub Desktop.
Save jethrokuan/6b6b0f6d83b29749fecdd3c3fb55a363 to your computer and use it in GitHub Desktop.
Ocaml Environment
with import <nixpkgs> {};
let
ocamlPackages = pkgs.recurseIntoAttrs pkgs.ocamlPackages_latest;
findlibSiteLib = "${ocamlPackages.findlib}/lib/ocaml/${ocamlVersion}/site-lib";
ocamlVersion = (builtins.parseDrvName ocamlPackages.ocaml.name).version;
ocamlInit = pkgs.writeText "ocamlinit" ''
let () =
try Topdirs.dir_directory "${findlibSiteLib}"
with Not_found -> ()
;;
#use "topfind";;
#thread;;
#require "core.top";;
#require "core.syntax";;
'';
in
stdenv.mkDerivation rec {
name = "rwo-shell";
buildInputs = with ocamlPackages; [
ocaml
core
core_extended
base
utop
findlib
];
shellHook = ''
alias utop = "utop -init ${ocamlInit}""
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment