NixOS/nixpkgs — pull request #1019 by rickynils (2013-09-27 13:09:14+00:00)
Title: Add nix-run and myEnvRun

This adds nix-run, which is a thin wrapper around nix-build.
nix-run calls nix-build, and then executes the resulting build.
If no executable artifact is built, nix-runs outputs an error
message.

myEnvRun calls myEnvFun and builds a script that directly runs
the load-env-* script.

Together, nix-run and myEnvRun allows you to set up an environment
that can be loaded in this way:

envs.nix:
{
gcc = myEnvRun {
name = "gcc";
buildInputs = [ gcc ];
};
}

$ nix-run -A gcc envs.nix

You end up directly in your environment without having to do
nix-env -i. You will always have a fresh environment and you
don't have to pollute you profile with a lot of env packages.