aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/flakeref.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-28 18:05:50 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-03-28 18:05:50 +0100
commit2287e2f279ac544a2c11921be51f2f556cb78abc (patch)
tree331cdc7c1a185306999ac36a8229225d7decab77 /src/libexpr/flake/flakeref.cc
parent5f75d56c9bb4937b7cc9b7f20b31ef151adf4497 (diff)
nix flake info: Show flake subdirectory
Diffstat (limited to 'src/libexpr/flake/flakeref.cc')
-rw-r--r--src/libexpr/flake/flakeref.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc
index f97679dd9..5c38f7ea5 100644
--- a/src/libexpr/flake/flakeref.cc
+++ b/src/libexpr/flake/flakeref.cc
@@ -16,7 +16,10 @@ const static std::string subDirRegex = subDirElemRegex + "(?:/" + subDirElemRege
std::string FlakeRef::to_string() const
{
- return input->to_string();
+ auto url = input->toURL();
+ if (subdir != "")
+ url.query.insert_or_assign("dir", subdir);
+ return url.to_string();
}
fetchers::Attrs FlakeRef::toAttrs() const