[Nix-dev] Building with default.nix

Roger Qiu roger.qiu at matrix.ai
Fri Aug 12 09:03:53 CEST 2016


I'd recommend to fix the content address of your nixpkgs in order to make
your default.nix reproducible. Right now you're relying on an environment
variable that determines the revision of nixpkgs.
On 09/08/2016 8:53 PM, "Rodney Lorrimar" <dev at rodney.id.au> wrote:

> 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/20160812/064d9572/attachment.html>


More information about the nix-dev mailing list