aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-09-29 23:42:43 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-09-29 23:42:43 +0200
commit76f000712ed3aa8f258d68fc5ef036f1255dfada (patch)
tree7f68caf85244b2d289d6e8a4a28ebb5bc664a5e3 /src/libexpr
parent64e9b3c83b7cf7f3c7348426666ccca2ca395d28 (diff)
parentcb186f1e7536c9448455bfbf8dec16ad6600e88e (diff)
Merge branch 'kwq/path-dir-query' of https://github.com/kquick/nix
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/flake/flakeref.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc
index 87b202643..833e8a776 100644
--- a/src/libexpr/flake/flakeref.cc
+++ b/src/libexpr/flake/flakeref.cc
@@ -157,7 +157,8 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment(
} else {
if (!hasPrefix(path, "/"))
throw BadURL("flake reference '%s' is not an absolute path", url);
- path = canonPath(path);
+ auto query = decodeQuery(match[2]);
+ path = canonPath(path + "/" + get(query, "dir").value_or(""));
}
fetchers::Attrs attrs;