@@ -13,6 +13,7 @@ usage () {
1313
1414xml=false
1515verbose=false
16+nixPath=""
1617
1718option=""
1819
@@ -26,6 +27,7 @@ for arg; do
2627 while test "$sarg" != "-"; do
2728 case $sarg in
2829 --*) longarg=$arg; sarg="--";;
30+ -I) argfun="include_nixpath";;
2931 -*) usage;;
3032 esac
3133 # remove the first letter option
@@ -53,6 +55,9 @@ for arg; do
5355 var=$(echo $argfun | sed 's,^set_,,')
5456 eval $var=$arg
5557 ;;
58+ include_nixpath)
59+ nixPath="-I $arg $nixPath"
60+ ;;
5661 esac
5762 argfun=""
5863 fi
@@ -69,14 +74,17 @@ fi
6974#############################
7075
7176evalNix(){
72− result=$(nix-instantiate - --eval-only "$@" 2>&1)
77+ result=$(nix-instantiate ${nixPath:+$nixPath} - --eval-only "$@" 2>&1)
7378 if test $? -eq 0; then
7479 cat <<EOF
7580$result
7681EOF
7782 return 0;
7883 else
79− sed -n '/error/ { s/, at (string):[0-9]*:[0-9]*//; p; }' <<EOF
84+ sed -n '
85+ /^error/ { s/, at (string):[0-9]*:[0-9]*//; p; };
86+ /^warning: Nix search path/ { p; };
87+' <<EOF
8088$result
8189EOF
8290 return 1;