[Nix-dev] Building with default.nix
Lancelot SIX
lsix.nix at lancelotsix.com
Tue Aug 9 18:04:30 CEST 2016
Hi,
You could have a `shell.nix` file as follows:
import ./default.nix { sampleproject = { outPath = ""; name = "sampleproject"; } ; }
This is hacky but with that you will not copy the project tree into the nix store when runninx `nix-shell` (this will only be done when running `nix-build`). I think this is half way to what you are looking for.Hope this helps.
Cheers
Lancelot
Le lundi 08 août 2016 à 22:15 +0100, Rodney Lorrimar a écrit :
> Hello nix-dev,
>
> I was wondering, what is the best way to develop a project outside of
> nixpkgs? My current method is something like this:
>
> # default.nix
> { sampleproject ? { outPath = ./.; name = "sampleproject"; }
> , pkgs ? import <nixpkgs> {}
> }:
> with pkgs.python35Packages;
> buildPythonPackage rec {
> name = "sampleproject-${version}";
> version = "1.2.0";
> src = [ sampleproject ];
> propagatedBuildInputs = [ peppercorn ];
> };
>
> (Full project example here: https://github.com/rvl/sampleproject)
>
> In many ways it works well, but I'm not entirely happy.
>
> The problem is that my entire work tree (and all the accumulated
> project
> cruft) gets copied into the nix store every time I run nix-build or
> nix-shell. This is slow and also prints the scary "may run out of
> memory" warning.
>
> Is there a function to load only the tracked files from a git work
> tree?
> Ideally this function would result in same store path if the files
> are
> the same, so nothing need be rebuilt if no sources changed.
>
>
> Cheers,
>
> Rodney
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160809/686b9dd3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160809/686b9dd3/attachment.sig>
More information about the nix-dev
mailing list