@@ -0,0 +1,27 @@
1+#!/usr/bin/env sh
2+
3+if [ "$#" -lt 1 ]; then
4+ cat <<EOF
5+
6+Usage: $0 TARGET
7+
8+Create an appdir from the nixpkgs attribute "TARGET".
9+EOF
10+
11+ exit 1
12+fi
13+
14+target="$1"
15+
16+expr="with import <nixpkgs> {}; with import ./. {}; appdir { name = \"$target\"; target = $target; }"
17+
18+out=$(nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr"))
19+
20+if [ -z "$out" ]; then
21+ echo "$0 failed. Exiting."
22+ exit 1
23+else
24+ rm -f result
25+ ln -sf $out/*.AppDir result
26+ echo "AppImage created at result"
27+fi