@@ -13,6 +13,7 @@ usage () {
15verbose=false
15verbose=false
@@ -26,6 +27,7 @@ for arg; do
26 while test "$sarg" != "-"; do
27 while test "$sarg" != "-"; do
27 case $sarg in
28 case $sarg in
28 --*) longarg=$arg; sarg="--";;
29 --*) longarg=$arg; sarg="--";;
30+ -I) argfun="include_nixpath";;
29 -*) usage;;
31 -*) usage;;
31 # remove the first letter option
33 # remove the first letter option
@@ -53,6 +55,9 @@ for arg; do
53 var=$(echo $argfun | sed 's,^set_,,')
55 var=$(echo $argfun | sed 's,^set_,,')
54 eval $var=$arg
56 eval $var=$arg
59+ nixPath="-I $arg $nixPath"
@@ -69,14 +74,17 @@ fi
69#############################
74#############################
72− result=$(nix-instantiate - --eval-only "$@" 2>&1)
77+ result=$(nix-instantiate ${nixPath:+$nixPath} - --eval-only "$@" 2>&1)
73 if test $? -eq 0; then
78 if test $? -eq 0; then
79− sed -n '/error/ { s/, at (string):[0-9]*:[0-9]*//; p; }' <<EOF
85+ /^error/ { s/, at (string):[0-9]*:[0-9]*//; p; };
86+ /^warning: Nix search path/ { p; };