nixpkgs-basic-release-checks: set NIX_STORE_DIR

With nix 2.4 the fact that we set NIX_STATE_DIR, but kept the original
store became a hard error. We work around it here by forcing the use of
a fresh, sandbox-local, store.

See regnat's wonderful analysis for more information:
https://github.com/NixOS/nix/issues/5495#issuecomment-963949707
This commit is contained in:
Bernardo Meurer 2021-11-09 10:55:04 -08:00
parent 90c1cdd93f
commit ca5ecbed4b
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -3,7 +3,8 @@
pkgs.runCommand "nixpkgs-release-checks" { src = nixpkgs; buildInputs = [nix]; } ''
set -o pipefail
export NIX_STATE_DIR=$TMPDIR
export NIX_STORE_DIR=$TMPDIR/store
export NIX_STATE_DIR=$TMPDIR/state
export NIX_PATH=nixpkgs=$TMPDIR/barf.nix
opts=(--option build-users-group "")
nix-store --init