on master help sign in
nix-bundle/appdir.sh
27 lines 514 B history raw
1#!/usr/bin/env sh
3if [ "$#" -lt 1 ]; then
4 cat <<EOF
6Usage: $0 TARGET
8Create an appdir from the nixpkgs attribute "TARGET".
9EOF
11 exit 1
12fi
14target="$1"
16expr="with import <nixpkgs> {}; with import ./appimage-top.nix {}; appdir { name = \"$target\"; target = $target; }"
18out=$(nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr"))
20if [ -z "$out" ]; then
21 echo "$0 failed. Exiting."
22 exit 1
23else
24 rm -f result
25 ln -sf $out/*.AppDir result
26 echo "AppImage created at result"
27fi