[Nix-dev] Updating /etc/nix/nix.conf before building packages during nixos-rebuild
Mateusz Kowalczyk
fuuzetsu at fuuzetsu.co.uk
Fri May 23 20:39:31 CEST 2014
On 05/23/2014 09:44 AM, Luca Bruno wrote:
> 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.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
This does what I want. Perhaps nixos-rebuild manual should mention
--options, otherwise the user has to look for binary-caches in Nix
manual itself.
Thanks
--
Mateusz K.
More information about the nix-dev
mailing list