[Nix-dev] overriding a package

Bjørn Forsman bjorn.forsman at gmail.com
Sat Jan 31 16:50:46 CET 2015


On 31 January 2015 at 16:41, Catonano <catonano at gmail.com> wrote:
>
>
> 2015-01-31 16:20 GMT+01:00 Bjørn Forsman <bjorn.forsman at gmail.com>:
>>
>> On 31 January 2015 at 16:14, Catonano <catonano at gmail.com> wrote:
>>
>> I don't think you placed the "pkgs.fetchurl" where I meant. In the
>> code you pasted, there was only one "fetchurl". Replace that one with
>> "pkgs.fetchurl" (without the quotes).
>>
>> - Bjørn
>
>
> Here it is
>
> {
>      packageOverrides = pkgs: rec {
>
>        # Create a new package, "myDrRacket", which is identical to an
>        #   existing package, "racket", but uses a different version.
>        myRacket = pkgs.stdenv.lib.overrideDerivation pkgs.racket (oldAttrs:
> {
>          pname = "InfTaRacket";
>      version = "6.1.1.8";
>      #name = "${pname}-${version}";
>          src = pkgs.fetchurl {
>            url =
> http://www.cs.utah.edu/plt/snapshots/current/installers/racket-6.1.1.8-src.tgz;
>            sha256 =
> "c9b4b634cdda62841739ed41179ed3daf42b7231cd024d8d3a7b39cfe0e44fc3";
>          };
>          patches = [];
>        });
>      };
>    }
>
> And this is the result
>
> error: anonymous function at "/home/me/.nixpkgs/config.nix":1:1 called with
> unexpected argument ‘pkgs’, at
> "/nix/store/i99ncvcy3p4awz7b0m35gcknkizzrpag-nixpkgs-15.05pre55083.597373b/nixpkgs/pkgs/top-level/all-packages.nix":67:14

That's weird. I copy/pasted your code into my ~/.nixpkgs/config.nix
and it worked just fine.

- Bjørn


More information about the nix-dev mailing list