1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00

Don't update the global registry when building a locked flake

It's unnecessary and slows things down (e.g. when you're on a Thalys
with super-crappy Internet).
This commit is contained in:
Eelco Dolstra 2019-06-21 18:34:43 +02:00
parent d132d057a8
commit aa2846198f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 7 additions and 2 deletions

View file

@ -168,6 +168,9 @@ git -C $flake2Dir commit flake.lock -m 'Add flake.lock'
nix build -o $TEST_ROOT/result --flake-registry $registry $flake2Dir:bar
[[ -z $(git -C $flake2Dir diff master) ]]
# Building with a lockfile should not require a fetch of the registry.
nix build -o $TEST_ROOT/result --flake-registry file:///no-registry.json $flake2Dir:bar --tarball-ttl 0
# Updating the flake should not change the lockfile.
nix flake update --flake-registry $registry $flake2Dir
[[ -z $(git -C $flake2Dir diff master) ]]
@ -297,7 +300,7 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake3:xyzzy flake3:fn
# Test doing multiple `lookupFlake`s
nix build -o $TEST_ROOT/result --flake-registry $registry flake4:xyzzy
nix build -o $TEST_ROOT/result --flake-registry $registry file://$flake4Dir:xyzzy
#nix build -o $TEST_ROOT/result --flake-registry $registry file://$flake4Dir:xyzzy
# Make branch "removeXyzzy" where flake3 doesn't have xyzzy anymore
git -C $flake3Dir checkout -b removeXyzzy