Merge branch 'kwq/path-dir-query' of https://github.com/kquick/nix

This commit is contained in:
Eelco Dolstra 2020-09-29 23:42:43 +02:00
commit 76f000712e

View file

@ -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;