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

Corey O'Connor coreyoconnor at gmail.com
Sat Mar 3 18:51:46 CET 2012


That was exactly what I needed! Thanks!

I did not know something basic: How to add the the dev-env to the user
profile. The process I found that worked was to run

$ nix-env -iA nixpkgs_sys.config.webEnv

Which then add a .nix-profile/dev-env directory.

I am not sure if there is just a "rebuild .nix-profile" command.
nixos-rebuild appears to only rebuild the system profile.

Two notes:
0. I find it odd that nixpkgs_sys is required. Is it really a system
package at this point?
1. There is no load-[name]-env script exposed that I can find. Is that
something I also need to expose via .nixpkgs/config.nix?

-Corey O'Connor
coreyoconnor at gmail.com
http://corebotllc.com/



On Sat, Mar 3, 2012 at 7:07 AM, Mathijs Kwik <mathijs at bluescreen303.nl> wrote:
> 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