Copying a local path as a flake input causes hang on Mac

When I add a local path as a flake input like below, build causes hanging

{
  inputs.tree-sitter.url = "path:/Users/bglgwyng/Documents/GitHub/tree-sitter";
  # ...
}

with the following message.

copying "/Users/bglgwyng/Documents/GitHub/tree-sitter" to the store

I’ve never had the same experience on NixOS, but it frequently occurs on Mac.
Does anyone know about this?

How big is that folder? It’ll copy the whole thing including .git and any untracked files.
You should not use path:. If it’s a git repo, you’re copying bits that aren’t used; if it’s not a git repo… let nix figure that out instead.

Thanks! I didn’t know git+file: protocol.

I meant you should specify no protocol and let nix infer it automatically. But yeah git+file:// is fine in this case, since that’s what nix will end up using if the flake is a git repo.

Hmm… I suspect that Mac prefers path:/ to git+profile for default protocol while Linux does the opposite. I frequently omit the protocol part, but on Linux it’s been ok.

1 Like

There shouldn’t be any preference by the OS. Though git: flakes will only copy files known to git while path: flakes will copy everything in the folder, recursively.