aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/installables.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 631a849cd..f3be7b628 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -219,12 +219,18 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
else if ((colon = s.rfind(':')) != std::string::npos) {
auto flakeRef = std::string(s, 0, colon);
auto attrPath = std::string(s, colon + 1);
- result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef(flakeRef), attrPath));
+ result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef(flakeRef, true), attrPath));
}
- else if (s.find('/') != std::string::npos) {
- auto path = store->toStorePath(store->followLinksToStore(s));
- result.push_back(std::make_shared<InstallableStorePath>(path));
+ else if (s.find('/') != std::string::npos || s == ".") {
+ Path storePath;
+ try {
+ storePath = store->toStorePath(store->followLinksToStore(s));
+ } catch (Error) { }
+ if (storePath != "")
+ result.push_back(std::make_shared<InstallableStorePath>(storePath));
+ else
+ result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef(s, true), "defaultPackage"));
}
else