From 5d70b454be7da683bf9f265d95cd0066140ea956 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 1 Feb 2020 12:26:05 +0100 Subject: [PATCH] nix flake update: Imply --refresh --- src/nix/flake.cc | 3 +++ tests/flakes.sh | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 9b23570bd..dc576c82d 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -119,6 +119,9 @@ struct CmdFlakeUpdate : FlakeCommand void run(nix::ref store) override { + /* Use --refresh by default for 'nix flake update'. */ + settings.tarballTtl = 0; + lockFlake(); } }; diff --git a/tests/flakes.sh b/tests/flakes.sh index 2e4abf48d..57081f72f 100644 --- a/tests/flakes.sh +++ b/tests/flakes.sh @@ -589,8 +589,7 @@ nix flake info --json hg+file://$flake5Dir nix build -o $TEST_ROOT/result hg+file://$flake5Dir --no-registries --no-allow-dirty # Test tarball flakes -rm -rf $flake5Dir/.hg -tar cfz $TEST_ROOT/flake.tar.gz -C $TEST_ROOT flake5 +tar cfz $TEST_ROOT/flake.tar.gz -C $TEST_ROOT --exclude .hg flake5 nix build -o $TEST_ROOT/result file://$TEST_ROOT/flake.tar.gz