This fixes an issue where nix would try to check out invalid URLs,
because it would pass 'dir' to the HTTP endpoint.
For later versions this was fixed in
b2be6fed86. This is a backport of just the
relevant part.
See #12417
This does not include any automation for the release branch, but
is based on the configuration of https://github.com/NixOS/nix/pull/12349
pre-commit run -a nixfmt-rfc-style
Progress on #5638
There are still a global fetcher and eval settings, but they are pushed
down into `libnixcmd`, which is a lot less bad a place for this sort of
thing.
Continuing process pioneered in
52bfccf8d8.