Have you considered using builtins.filterSource ?  I usually do something
like this:

let sourceFilesOnly = path: type:
    (lib.hasPrefix "var" (toString path)) ||
    (lib.hasPrefix "target" (toString path)) ;
in stdenv.mkDerivation {
    src = builtins.filterSource sourceFilesOnly ./.;
    # ...

It's not as tight as "git tracked files only" but works well enough for
e.g. Clojure projects where I can reasonably get build artefacts to go into
target/ so at least I'm not copying huge jar files into the store.
Likewise in a Ruby project I'd exclude vendor/bundle the same way

Any use?

-dan

-- 
d...@telent.net
http://ww.telent.net
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to