about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index e4cc66e76194..9f51e919b0e9 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -131,9 +131,12 @@ static void getAllExprs(EvalState & state,
                 continue;
             }
             attrs.insert(attrName);
-            // FIXME: make loading lazy.
-            Value & v2(*state.allocAttr(v, state.symbols.create(attrName)));
-            state.evalFile(path2, v2);
+            /* Load the expression on demand. */
+            Value & vFun(*state.allocValue());
+            Value & vArg(*state.allocValue());
+            state.getBuiltin("import", vFun);
+            mkString(vArg, path2);
+            mkApp(*state.allocAttr(v, state.symbols.create(attrName)), vFun, vArg);
         }
         else if (S_ISDIR(st.st_mode))
             /* `path2' is a directory (with no default.nix in it);