ocaml - How to use nix-shell properly and avoid "dumping very large path"? -
based on readings (notably the wiki , this blog post), have come following default.nix
load nix-shell
:
with import <nixpkgs> {}; let emacs = emacswithpackages (p : [ p.tuareg ]); in stdenv.mkderivation rec { name = "env"; src = ./.; # customizable development requirements buildinputs = [ pkgconfig ocaml ocamlpackages.merlin ocamlpackages.findlib ocamlpackages.lablgtk ocamlpackages.camlp5_transitional ncurses emacs ]; # customizable development shell setup shellhook = '' export path=`pwd`/bin:$path ''; }
but prints warning:
warning: dumping large path (> 256 mib); may run out of memory
and takes quite long load (about 45 seconds first time call nix-shell
after start-up, 2 seconds on subsequent calls).
what meaning of message? when on google, find few github issues not expressed in way easy understand layman.
can speed load , remove message? seems me i'm doing wrong.
are there general recommendations on writing kind of development environment might not aware of?
probably src
attribute (the current directory) big. nix-shell
copy nix store on each invocation, not want/need. workaround write:
src = if lib.innixshell null else nix;
(where lib
comes nixpkgs).
this way, ./.
copied when invoke nix-build
, not when run nix-shell
.
Comments
Post a Comment