summaryrefslogtreecommitdiff
path: root/modules/ocaml.nix
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-12-11 19:16:08 +0100
committerQuentin Aristote <quentin@aristote.fr>2021-12-11 19:16:08 +0100
commit44406416d7bc42f011271bff010d8fd7f24aa3ef (patch)
treef9d00889e2241b9c80ac33655959ce37317cf677 /modules/ocaml.nix
parent7ed5d61859ffe1a468a38c1b241d37918d411995 (diff)
ocaml : add comments in declaration of ocamlInit
Diffstat (limited to 'modules/ocaml.nix')
-rw-r--r--modules/ocaml.nix16
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/ocaml.nix b/modules/ocaml.nix
index 8c42bee..748e2ec 100644
--- a/modules/ocaml.nix
+++ b/modules/ocaml.nix
@@ -17,23 +17,21 @@ let
stdlibDir = "${cfg.ocamlPackages.findlib}/lib/ocaml/${cfg.version}/site-lib";
ocamlInit = pkgs.writeText "ocamlinit" (
-
+ # load libs
(concatStringsSep "\n" (map (dir: ''
let () = try Topdirs.dir_directory "${dir}"
with Not_found -> ();;
- '') ([ stdlibDir ] ++ cfg.toplevel.libDirs)))
-
- + ''
+ '') ([ stdlibDir ] ++ cfg.toplevel.libDirs))) + ''
#use "topfind";;
''
-
- + (optionalString cfg.toplevel.list "#list;;")
-
+ # enable threading
+ (optionalString cfg.toplevel.thread "#thread;;")
-
+ # list packages
+ + (optionalString cfg.toplevel.list "#list;;")
+ # require packages
+ (concatStringsSep "\n"
(map (pkg: ''# require "${pkg.pname}";;'') userPackages))
-
+ # additional init commands
+ cfg.toplevel.extraInit
);