When starting a new repository, it does not have any branches
in `.git/refs/heads` and `.git/refs/HEAD` contains a broken
`ref: refs/heads/master` reference.
This means that cloning a repo like we do for cleaning will fail
with very unhelpful message for freshly created repo:
fatal: bad revision 'HEAD'
This is quite confusing when you create a new repo by copying
Nix files from another, working one, make some trivial changes,
stage them and then try to test a shell.
* `url` got renamed to `host` in Nix[1], so we have to use this key here
as well.
* It was suggested previously[2] to use the same URL to download from a
GitLab-server as Nix does.
[1] 56f1e0df05
[2] 0e29814f1e (commitcomment-42619895)
If no inputs but "self" are specified, Nix will not generate a
flake.lock at all. In this case, Flakes are mostly just used to
provide a more pure Nix experience, while sources are locked through
some other means (niv, ob thunk, manually, etc.). Supporting this is a
little weird, but it ends up working for my
repo (https://github.com/matthewbauer/nixiosk).
The goal is to filter the provided src tree based on Git tracked files
to avoid unexpected rebuild. If the provided src tree is a not valid Git
repository, no filtering is applied.