diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2021-12-06 12:15:51 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2021-12-27 09:35:59 +0100 |
| commit | cc73868d14f7b75e599b33b728c7946d66f5260f (patch) | |
| tree | bd947bafd53e9636f1d9adc6d2fa7e480947a0c2 | |
| parent | 44406416d7bc42f011271bff010d8fd7f24aa3ef (diff) | |
remove quoting around nix paths cast to strings
| -rw-r--r-- | modules/ocaml.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/ocaml.nix b/modules/ocaml.nix index 748e2ec..661436a 100644 --- a/modules/ocaml.nix +++ b/modules/ocaml.nix @@ -16,6 +16,9 @@ let ++ userPackages; stdlibDir = "${cfg.ocamlPackages.findlib}/lib/ocaml/${cfg.version}/site-lib"; + parseOcamlDrvName = with builtins; + pkg: + head (match "ocaml${cfg.version}-(.*)" (parseDrvName pkg.name).name); ocamlInit = pkgs.writeText "ocamlinit" ( # load libs (concatStringsSep "\n" (map (dir: '' @@ -30,7 +33,8 @@ let + (optionalString cfg.toplevel.list "#list;;") # require packages + (concatStringsSep "\n" - (map (pkg: ''# require "${pkg.pname}";;'') userPackages)) + (map (pkg: ''# require "${parseOcamlDrvName pkg}";;'') + userPackages)) # additional init commands + cfg.toplevel.extraInit |
