[Nix-dev] [nix-dev] Re: Developing R modules with nix

Michel Kuhlmann michel at kuhlmanns.info
Tue Sep 16 06:02:25 CEST 2014


> 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. :-)

Thanks Peter for clarification; is this the preferred way to declare
user-packages? Could you argue about benefits or drawbacks of the *Wrapper
vs *ToolsEnv approach?

-Michel


More information about the nix-dev mailing list