[Nix-dev] how to overwrite a derivation in nix

Thomas Bereknyei tomberek at gmail.com
Fri Jan 10 16:42:37 CET 2014


I work off of a local fork of nixpkgs, I tried overriding just
particular attributes, but it was annoying. I use this sort of thing
to add temp packages:

nixpkgs.config.packageOverrides = pkgs : with pkgs.haskellPackages_ghc763; {
        happstackFastCGI = callPackage ./patch/happstack-fastcgi.nix {};
 };

This has been useful for patching without polluting the repo:

nixpkgs.config.packageOverrides = pkgs : with pkgs; {
   shellinabox = callPackage ./patch/shellinabox.nix {};

That way when I am ready to send a PR, I move that nix expression into
the repo and push.

-Tom

On Fri, Jan 10, 2014 at 8:34 AM,  <phreedom at yandex.ru> wrote:
> On Friday, January 10, 2014 02:20:16 PM Sergey wrote:
>> Hi, list! Does nixpkgs library contain a function able to overwrite an
>> existing derivation? I would like the following usage pattern to be
>> possible:
>>
>> with pkgs; {
>>
>> thunar_with_whistles = overwrite pkgs.thunar (old:{
>>    patches = old.patches ++ [ ./add_whistles.patch ];
>> });
>>
>> }
>
> Take a look at overrideDerivation.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list