about summary refs log tree commit diff
path: root/tests/build-hook.sh
blob: 6a71bbe56173108d6f219ff9f3dc62435ffdc4e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
source common.sh

export NIX_BUILD_HOOK="build-hook.hook.sh"

drvPath=$($TOP/src/nix-instantiate/nix-instantiate build-hook.nix)

echo "derivation is $drvPath"

outPath=$($TOP/src/nix-store/nix-store -quf "$drvPath")

echo "output path is $outPath"

text=$(cat "$outPath"/foobar)
if test "$text" != "BARBAR"; then exit 1; fi