@@ -1,35 +1,35 @@
4−if ! [ $# -eq 0 ]; then
3+if [ $# -gt 0 ]; then
8# should download this in the future
7# should download this in the future
9# but the mirror is down
8# but the mirror is down
10−proot=`dirname $0`/proot-`uname -p`
9+proot=$(dirname "$0")/proot-$(uname -p)
11export PROOT_NO_SECCOMP=1
10export PROOT_NO_SECCOMP=1
13nixdir=$HOME/.nix
12nixdir=$HOME/.nix
15OLD_NIX_PATH=$NIX_PATH
14OLD_NIX_PATH=$NIX_PATH
15+# shellcheck disable=SC1090
16−if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
16+if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then . "$HOME/.nix-profile/etc/profile.d/nix.sh"; fi
17−if ! [ -z "$OLD_NIX_PATH" ]; then NIX_PATH="$OLD_NIX_PATH"; fi
17+if [ -n "$OLD_NIX_PATH" ]; then NIX_PATH="$OLD_NIX_PATH"; fi
19if [ -z "$IN_PROOT" ]; then
19if [ -z "$IN_PROOT" ]; then
20 export IN_PROOT=1
20 export IN_PROOT=1
22− if ! [ -d $nixdir ]; then
22+ if ! [ -d "$nixdir" ]; then
23− mkdir -p $nixdir
23+ mkdir -p "$nixdir"
24 s=$(mktemp)
24 s=$(mktemp)
25− curl https://nixos.org/nix/install -o $s
25+ curl https://nixos.org/nix/install -o "$s"
26− $proot -b $nixdir:/nix $0 sh $s
26+ $proot -b "$nixdir:/nix" "$0" sh "$s"
29− $proot -b $nixdir:/nix $0 $cmd
29+ $proot -b "$nixdir:/nix" "$0" "$@"
31 export IN_PROOT=
31 export IN_PROOT=
33−elif ! [ $# -eq 0 ]; then
33+elif [ $# -gt 0 ]; then
34− exec $cmd
34+ exec "$@"