1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

Add path flakeref variant

Unlike file://<path>, this allows the path to be a dirty Git tree, so

  nix build /path/to/flake:attr

is a convenient way to test building a local flake.
This commit is contained in:
Eelco Dolstra 2019-04-08 22:46:25 +02:00
parent a9ceeeb4b0
commit 6a4c7fb975
6 changed files with 49 additions and 5 deletions

View file

@ -170,7 +170,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
json["uri"] = uri;
json["name"] = name;
json["rev"] = gitInfo.rev;
json["revCount"] = gitInfo.revCount;
json["revCount"] = *gitInfo.revCount;
writeFile(storeLink, json.dump());
@ -224,7 +224,7 @@ static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Va
mkString(*state.allocAttr(v, state.sOutPath), gitInfo.storePath, PathSet({gitInfo.storePath}));
mkString(*state.allocAttr(v, state.symbols.create("rev")), gitInfo.rev);
mkString(*state.allocAttr(v, state.symbols.create("shortRev")), gitInfo.shortRev);
mkInt(*state.allocAttr(v, state.symbols.create("revCount")), gitInfo.revCount);
mkInt(*state.allocAttr(v, state.symbols.create("revCount")), gitInfo.revCount.value_or(0));
v.attrs->sort();
if (state.allowedPaths)