Created
March 5, 2018 13:19
-
-
Save archaeron/1114565ab9823b412fe1d24dd82d6975 to your computer and use it in GitHub Desktop.
Ocaml Nix
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_4_03; | |
ocamlVersion = (builtins.parseDrvName ocamlPackages.ocaml.name).version; | |
findlibSiteLib = "${ocamlPackages.findlib}/lib/ocaml/${ocamlVersion}/site-lib"; | |
ocamlInit = pkgs.writeText "ocamlinit" '' | |
let () = | |
try Topdirs.dir_directory "${findlibSiteLib}" | |
with Not_found -> () | |
;; | |
#use "topfind";; | |
#thread;; | |
#camlp4o;; | |
#require "core";; | |
#require "core.syntax";; | |
''; | |
in | |
stdenv.mkDerivation rec { | |
name = "rwo-shell"; | |
src = null; | |
buildInputs = with ocamlPackages; | |
[ ocaml | |
camlp4 | |
core | |
core_extended | |
findlib | |
merlin | |
base | |
utop | |
]; | |
# CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRAkRY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${name}/"; | |
UTOP_SITE_LISP = "${ocamlPackages.utop}/share/emacs/site-lisp"; | |
OCAMLINIT = "${ocamlInit}"; | |
shellHook = '' | |
alias utop="utop -init ${ocamlInit}" | |
alias ocaml="ocaml -init ${ocamlInit}" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment