about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-12T15·01+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-12T15·01+0100
commit9fa12fc2015c9cbc34bcf9d83e7396ba5dbc81a9 (patch)
tree388441a167bcde8c56d16a21d0eaa246c86c1c53 /src/nix-env/nix-env.cc
parent3ad53e43c8ca35cc581ebc3dd880c11892c8e016 (diff)
Allow setting the profile location using $NIX_PROFILE
Fixes #69.
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index b57e54c758f6..68a3e89d8c7e 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -1350,6 +1350,9 @@ void run(Strings args)
 
     if (!op) throw UsageError("no operation specified");
 
+    if (globals.profile == "")
+        globals.profile = getEnv("NIX_PROFILE", "");
+
     if (globals.profile == "") {
         Path profileLink = getHomeDir() + "/.nix-profile";
         globals.profile = pathExists(profileLink)