Last active
December 4, 2018 06:20
-
-
Save jethrokuan/6b6b0f6d83b29749fecdd3c3fb55a363 to your computer and use it in GitHub Desktop.
Ocaml Environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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