aboutsummaryrefslogtreecommitdiff
path: root/src/nix/app.cc
diff options
context:
space:
mode:
authortomberek <tomberek@users.noreply.github.com>2023-02-13 08:57:19 -0500
committerGitHub <noreply@github.com>2023-02-13 08:57:19 -0500
commit601faa00d7d29796303194ceac2086656a4b6323 (patch)
treecf5f28a8a8d1d5a09e1bbc57963a9c84e2ab0b93 /src/nix/app.cc
parentc205d10c669137da90c176669838a6c6d9158939 (diff)
parent45fa297e4052acef962d9d124241e7abd02f58af (diff)
Merge pull request #7744 from obsidiansystems/split-installable-store-path
Factor out `InstallableStorePath` to its own file, dedup
Diffstat (limited to 'src/nix/app.cc')
-rw-r--r--src/nix/app.cc27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/nix/app.cc b/src/nix/app.cc
index 08cd0ccd4..5cd65136f 100644
--- a/src/nix/app.cc
+++ b/src/nix/app.cc
@@ -1,4 +1,5 @@
#include "installables.hh"
+#include "installable-derived-path.hh"
#include "store-api.hh"
#include "eval-inline.hh"
#include "eval-cache.hh"
@@ -8,30 +9,6 @@
namespace nix {
-struct InstallableDerivedPath : Installable
-{
- ref<Store> store;
- const DerivedPath derivedPath;
-
- InstallableDerivedPath(ref<Store> store, const DerivedPath & derivedPath)
- : store(store)
- , derivedPath(derivedPath)
- {
- }
-
- std::string what() const override { return derivedPath.to_string(*store); }
-
- DerivedPathsWithInfo toDerivedPaths() override
- {
- return {{derivedPath}};
- }
-
- std::optional<StorePath> getStorePath() override
- {
- return std::nullopt;
- }
-};
-
/**
* Return the rewrites that are needed to resolve a string whose context is
* included in `dependencies`.
@@ -146,7 +123,7 @@ App UnresolvedApp::resolve(ref<Store> evalStore, ref<Store> store)
for (auto & ctxElt : unresolved.context)
installableContext.push_back(
- std::make_shared<InstallableDerivedPath>(store, ctxElt));
+ std::make_shared<InstallableDerivedPath>(store, DerivedPath { ctxElt }));
auto builtContext = Installable::build(evalStore, store, Realise::Outputs, installableContext);
res.program = resolveString(*store, unresolved.program, builtContext);