mirror of
https://github.com/ilyakooo0/nix-bundle.git
synced 2024-09-11 06:55:53 +03:00
28 lines
514 B
Bash
Executable File
28 lines
514 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
if [ "$#" -lt 1 ]; then
|
|
cat <<EOF
|
|
|
|
Usage: $0 TARGET
|
|
|
|
Create an appdir from the nixpkgs attribute "TARGET".
|
|
EOF
|
|
|
|
exit 1
|
|
fi
|
|
|
|
target="$1"
|
|
|
|
expr="with import <nixpkgs> {}; with import ./appimage-top.nix {}; appdir { name = \"$target\"; target = $target; }"
|
|
|
|
out=$(nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr"))
|
|
|
|
if [ -z "$out" ]; then
|
|
echo "$0 failed. Exiting."
|
|
exit 1
|
|
else
|
|
rm -f result
|
|
ln -sf $out/*.AppDir result
|
|
echo "AppImage created at result"
|
|
fi
|