use filename instead of target for nix-bundle.sh

This commit is contained in:
Matthew Bauer 2017-02-12 19:34:45 -06:00
parent 07e28d9384
commit 06dab776d6

View File

@ -21,8 +21,9 @@ fi
target="$1"
exec="$2"
filename=$(basename $exec)
expr="with import <nixpkgs> {}; with import ./. {}; nix-bootstrap { name = \"$target\"; target = $target; run = \"$exec\"; }"
expr="with import <nixpkgs> {}; with import ./. {}; nix-bootstrap { name = \"$filename\"; target = $target; run = \"$exec\"; }"
out=$(nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr"))
@ -30,6 +31,6 @@ if [ -z "$out" ]; then
echo "$0 failed. Exiting."
exit 1
else
echo "Nix bundle created at $target."
cp -f $out $target
echo "Nix bundle created at $filename."
cp -f $out $filename
fi