about summary refs log tree commit diff
path: root/src/nix/run.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r--src/nix/run.cc26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc
index a30031ad07b4..bcfa74eb5f5f 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -1,6 +1,5 @@
 #include "command.hh"
 #include "common-args.hh"
-#include "installables.hh"
 #include "shared.hh"
 #include "store-api.hh"
 #include "derivations.hh"
@@ -13,7 +12,7 @@
 
 using namespace nix;
 
-struct CmdRun : StoreCommand, MixInstallables
+struct CmdRun : InstallablesCommand
 {
     CmdRun()
     {
@@ -31,20 +30,7 @@ struct CmdRun : StoreCommand, MixInstallables
 
     void run(ref<Store> store) override
     {
-        auto elems = evalInstallables(store);
-
-        PathSet pathsToBuild;
-
-        for (auto & elem : elems) {
-            if (elem.isDrv)
-                pathsToBuild.insert(elem.drvPath);
-            else
-                pathsToBuild.insert(elem.outPaths.begin(), elem.outPaths.end());
-        }
-
-        printMissing(store, pathsToBuild);
-
-        store->buildPaths(pathsToBuild);
+        auto outPaths = buildInstallables(store, false);
 
         auto store2 = store.dynamic_pointer_cast<LocalStore>();
 
@@ -103,14 +89,6 @@ struct CmdRun : StoreCommand, MixInstallables
 #endif
         }
 
-        PathSet outPaths;
-        for (auto & path : pathsToBuild)
-            if (isDerivation(path)) {
-                Derivation drv = store->derivationFromPath(path);
-                for (auto & output : drv.outputs)
-                    outPaths.insert(output.second.path);
-            } else
-                outPaths.insert(path);
 
         auto unixPath = tokenizeString<Strings>(getEnv("PATH"), ":");
         for (auto & path : outPaths)