[Nix-dev] Updating /etc/nix/nix.conf before building packages during nixos-rebuild

Luca Bruno lethalman88 at gmail.com
Fri May 23 09:44:56 CEST 2014


On 23/05/2014 03:50, Mateusz Kowalczyk wrote:
> Hi,
>
> I saw that Hydra built some packages that I want already, for example Qt
> 4.8.6. I need that and it takes a very long time (and usually OOMs) on
> my machine so I thought, hey, why not just fetch it from Hydra.
>
> I found binaryCaches option but it is set in /etc/nix/nix.conf that's
> generated from /etc/nixos/configuration.nix.
>
> The problem is that even if I set nix.binaryCaches = [ … ]; in my
> configuration.nix, it won't get applied until after the rebuild. Namely,
> nixos-rebuild wants to build Qt (and many others) itself, so it's not
> looking at the binary cache first.
>
> Is there a way to cheat it and generate nix.conf first and only then
> calculate which packages we can fetch and which we have to build?
>
> Notably, manually running
>
> nix-install-package --non-interactive --url
> http://hydra.nixos.org/build/11188799/nix/pkg/qt-4.8.6-i686-linux.nixpkg
>
> installs Qt fine and nixos-rebuild no longer wants to build it itself.
> That's great but there are many packages and I can't try to find each on
> Hydra by hand.
>
nixos-rebuild .... --option binary-caches "http://... ..." should do it.


More information about the nix-dev mailing list