about summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc4
-rw-r--r--src/nix-env/user-env.cc4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index dd2fa30481f7..d9b48e81c9fd 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -702,7 +702,7 @@ static void opSet(Globals & globals,
         PathSet paths = singleton<PathSet>(drv.queryDrvPath(globals.state));
         printMissing(*store, paths);
         if (globals.dryRun) return;
-        store->buildPaths(paths);
+        store->buildPaths(paths, globals.state.repair);
     }
     else {
         printMissing(*store, singleton<PathSet>(drv.queryOutPath(globals.state)));
@@ -1317,6 +1317,8 @@ void run(Strings args)
             globals.instSource.systemFilter = needArg(i, args, arg);
         else if (arg == "--prebuilt-only" || arg == "-b")
             globals.prebuiltOnly = true;
+        else if (arg == "--repair")
+            globals.state.repair = true;
         else {
             remaining.push_back(arg);
             if (arg[0] == '-') {
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc
index 510c5ca38179..d7de17901031 100644
--- a/src/nix-env/user-env.cc
+++ b/src/nix-env/user-env.cc
@@ -45,7 +45,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
             drvsToBuild.insert(i->queryDrvPath(state));
 
     debug(format("building user environment dependencies"));
-    store->buildPaths(drvsToBuild);
+    store->buildPaths(drvsToBuild, state.repair);
 
     /* Construct the whole top level derivation. */
     PathSet references;
@@ -132,7 +132,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
     
     /* Realise the resulting store expression. */
     debug("building user environment");
-    store->buildPaths(singleton<PathSet>(topLevelDrv.queryDrvPath(state)));
+    store->buildPaths(singleton<PathSet>(topLevelDrv.queryDrvPath(state)), state.repair);
 
     /* Switch the current user environment to the output path. */
     PathLocks lock;