aboutsummaryrefslogtreecommitdiff
path: root/src/nix/installables.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-31 22:17:39 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-31 22:17:39 +0200
commit8cb3bbd5044b8fbfc65f13455d1619a78ccf33a5 (patch)
treecd63e4b68b00abc1d0175c53b40b54ec61175270 /src/nix/installables.cc
parent8abb8647a33c3516026cd8a2954d34633377b23c (diff)
Fix handling of bare flakerefs containing a colon
Diffstat (limited to 'src/nix/installables.cc')
-rw-r--r--src/nix/installables.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 40248eb5d..38ae416e3 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -314,6 +314,10 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
Strings{"packages." + std::string(s, 8)}));
}
+ else if (auto flakeRef = parseFlakeRef(s, true))
+ result.push_back(std::make_shared<InstallableFlake>(*this, s,
+ getDefaultFlakeAttrPaths()));
+
else if ((colon = s.rfind(':')) != std::string::npos) {
auto flakeRef = std::string(s, 0, colon);
auto attrPath = std::string(s, colon + 1);
@@ -332,10 +336,6 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
getDefaultFlakeAttrPaths()));
}
- else if (auto flakeRef = parseFlakeRef(s, true))
- result.push_back(std::make_shared<InstallableFlake>(*this, s,
- getDefaultFlakeAttrPaths()));
-
else
result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef("nixpkgs"), s));
}