Test that untrusted config is ignored without --accept-flake-config

This commit is contained in:
Eelco Dolstra 2021-11-18 13:32:52 +01:00
parent 0961c1068a
commit 79f27500a4

View file

@ -25,5 +25,10 @@ cat <<EOF > flake.nix
} }
EOF EOF
# Without --accept-flake-config, the post hook should not run.
nix build < /dev/null
(! [[ -f post-hook-ran ]])
clearStore
nix build --accept-flake-config nix build --accept-flake-config
test -f post-hook-ran || fail "The post hook should have ran" test -f post-hook-ran || fail "The post hook should have ran"