[Nix-dev] best process for building from source under development?

Mathijs Kwik mathijs at bluescreen303.nl
Sat Mar 3 16:07:55 CET 2012


I use myEnvFun for that in my ~/.nixpkgs/config.nix:

webEnv = pkgs.myEnvFun {
  name = "webdev";
  buildInputs = [pkgs.stdenv pkgs.jruby165 pkgs.nodejs];
};

As you can see, I include stdenv there as well.
You are correct that auto* is in stdenv, but you normally don't have
the standard build environment loaded in your system/home profile.

A myEnvFun gives you custom environments setup files under
~/.nix-profile/dev-envs, which contain environment variables and
paths.
You can source this file (I believe Arie Middelkoop also automatically
added a shell script "load-[name]-env" that does this for you.
Then every time you want to work on your project, you load that env
and find all stdenv (and other packages you include) available to you.



On Sat, Mar 3, 2012 at 8:27 AM, Corey O'Connor <coreyoconnor at gmail.com> wrote:
> Hi All,
>
> Suppose I have a source directory for a product under development. I
> would like to setup the same build environment nix-build will use. I
> have tried setting the src attribute to the source directory. However
> this causes the entire product to be rebuilt every time. I also tried
> copying env-vars from a partial build to the development source
> directory then sourcing this before the standard autoreconf,
> ./configure, make process. This progressed farther but died trying to
> locate autoheader which I would presume was in the standard build
> environment.
>
> Am I missing something?
>
> -Corey O'Connor
> coreyoconnor at gmail.com
> http://corebotllc.com/
> _______________________________________________
> 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