srghma
srghma

Reputation: 5323

nix flakes: what is the difference between `nix build git+file:.` and `nix build path:.`

this is a continuation of https://discourse.nixos.org/t/can-i-use-flakes-within-a-git-repo-without-committing-flake-nix/18196/37?u=srghma

IF I enable nix flakes AND I am in the in the git repo

I found the following behavior

IF I do nix build . THEN nix will try to find the type of directory .

  • IF ./.git THEN type is git
  • IF ./.something-else-dont-know THEN type is mercurial
  • ...
  • IF nothing is found THEN type is path

but I can force nix to use specific type by using nix build git+file:. or nix build path:.


QUESTION:

  1. what is the difference?
  2. what is self-contained / hermetic evaluation?
  3. git-flake-evaluation is hermetic, but is path-flake-evaluation hermetic?
  4. does nix build git+file:. have some additional caching, that nix build path:. doesnt have?
  5. why not make nix build . just equal to nix build path:., instead of this find type automatically behavior, described above (Because: what problem its trying to solve? The problem, solutions to which require all these weird behaviors, like unsolicited git add behind the scenes? But I can easily get around/silence it with path:.? This nix-flakes design is so weird, reason is so shady)

Upvotes: 2

Views: 584

Answers (0)

Related Questions