[Nix-dev] how to use platform tools (gcc, libc) with nix ?

Yurii Kudryashov urkud.urkud at gmail.com
Mon Nov 19 18:45:49 CET 2007


On Nov 16, 2007 9:48 AM, Pierre Bourgin <pierre.bourgin at arteris.com> wrote:
> Hello,
>
> Contrary the nix purity philosophy, I would like to use a lot of
> tools/libs provided by my Linux distribution, instead of relying only on
> nix packages (and thus rebuild a complete system in the nix world).
> I would like also to keep the ability to easily switch from a platform
> tool onto a nix packaged one.
> Example:
>    . use libc from the platform (always)
>    . use gcc from the platform (/usr/bin/gcc)
>    . use a newer gcc than /usr/bin/gcc : use a nix package
>
> I've began to read file pkgs/top-level/all-packages.nix and files
> related to stdenv, but I can't figure out how to reach this goal.
It seems that you are looking for stdenvNative. For example you can
apply the following:

- if stdenvType = "i686-linux" then stdenvLinux
+ if stdenvType = "i686-linux" then stdenvNative

to stdenv/default.nix. It seems that after this patch system tools
will be used for building other packages. I haven't tried it but I
hope that it should work.

> In my mind, the most lazy way to do this will be to create
> my-packages.nix with a code like:
>   import ./pkgs/top-level/all-packages.nix
> then modify some attributes (or redefine them), in order to use the libc
> or gcc from the platform for instance.
It is not enough because in this case your "native" tools will not be
used for building other packages.

-- 
Yura
mailto: urkud.urkud at gmail.com



More information about the nix-dev mailing list