1

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 design is so weird, reason is so shady)
srghma
  • 4,770
  • 2
  • 38
  • 54
  • This is a kind of question you can better ask on the Discourse. – Alper Jun 23 '23 at 19:46
  • I don't agree completely. Question "how and why it works" is perfectly fine for stack overflow, it's just the only person that knows the answer is Eelco Dolstra. He could answer in 1 post. But he will probably not see this question, so we resort to discussions. – srghma Jun 30 '23 at 03:33
  • I have found that answer on "why" is that the "flakes ARE repositories" was the original idea of Eelco Dolstra. This answers question "why nix does git add in a shadowly manner". But, again, "why?" – srghma Jun 30 '23 at 03:34

0 Answers0