[Nix-dev] Developing R modules with nix

Peter Simons simons at cryp.to
Mon Sep 15 13:05:20 CEST 2014


Hi Michel,

 > packageOverrides = self: with pkgs; rec {
 >   rWrapper = pkgs.rWrapper.override {
 >     packages = with pkgs.rPackages; [ Defaults data_table ];
 >   };
 > }

if you write that code like so instead:

  packageOverrides = super: let self = super.pkgs; in
  {
    rWrapper = super.rWrapper.override {
      packages = with self.rPackages; [ Defaults data_table ];
    };
  };

then it should work just fine. 'super' refers to the package set before
the overrides are applied and 'self' is the package set after the
overrides have been applied. This distinction is important, because an
override like

    rWrapper = self.rWrapper.override { ...}

tries to replace itself with its value after having replaced itself with
its value after having replaced itself ... a.k.a. infinite recursion. :-)

Best regards,
Peter



More information about the nix-dev mailing list