[Nix-dev] Build a package with what I have right now without updating deps

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Tue May 27 03:03:16 CEST 2014


On 05/27/2014 01:52 AM, Mateusz Kowalczyk wrote:
> Hi,
> 
> Often I want to package some software. Normally what I do is bring my
> nixpkgs checkout up to date, create a new branch from master and write
> the expression.
> 
> My problem begins when I set out to try my expression out: if I run
> nix-env -i <my package> then nix will go out and try to pull in all the
> latest versions of packages as my tree was updated. While technically
> that's great and it ensures that my expression builds against what's in
> master right now, it's very inconvenient during development of the
> expression itself.
> 
> My specific example is that I'm writing an expression which depends on
> Qt4 at the moment so when I try to test it, it goes off to try and build
> qt4 first (which seems to have been updated somehow). The problem with
> this is that qt4 takes many, many hours to build if it builds at all so
> I'm currently stuck waiting either for my box to finish building Qt or
> for Hydra to finish building it in about 2-3 hours so I can fetch it.
> This wait is rather sub-optimal if all I care about is ‘does this
> expression build with my current setup?’. If I'm trying to quickly
> package something so I can use it 5 minutes later, it's often impossible.
> 
> How can I ask nix to use the packages I already have installed where
> possible? I'd rather leave testing of whether it works with current
> nixpkgs master for later, when I think I'm done writing the expression.
> 
> Thanks
> 

I found https://nixos.org/wiki/Create_and_debug_nix_packages which
mentions that we can use nixos-version to find out which commit we're at
and then work from that. I guess that works.

-- 
Mateusz K.


More information about the nix-dev mailing list