about summary refs log tree commit diff
path: root/scripts/nix-build.in
blob: a50901135ed6e4de03975b5dbd48f83a17f78e17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! @shell@ -e

nixExpr=$1

if test -z "$nixExpr"; then
    echo "syntax: $0 NIX-EXPR..." >&2
    exit 1
fi

extraArgs=

for i in "$@"; do
    case "$i" in
        -*)
            extraArgs="$extraArgs $i"
            ;;
        *)
            storeExpr=$(nix-instantiate "$i")
            echo "store expression is $storeExpr" >&2
            nix-store -qnfv $extraArgs $storeExpr
            ;;
    esac
done