Add nix-bootstrap.sh script.

This commit is contained in:
Matthew Bauer 2017-04-30 15:48:04 -05:00
parent 1b9cffd972
commit 9116aae7b8
2 changed files with 31 additions and 0 deletions

31
nix-bootstrap.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
cmd=sh
if ! [ $# -eq 0 ]; then
cmd=$@
fi
# should download this in the future
# but the mirror is down
proot=`dirname $0`/proot-`uname -p`
export PROOT_NO_SECCOMP=1
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
if [ -z "$IN_PROOT" ]; then
export IN_PROOT=1
if ! [ -d $HOME/.nix ]; then
mkdir -p $HOME/.nix
s=$(mktemp)
curl https://nixos.org/nix/install -o $s
$proot -b $HOME/.nix:/nix $0 sh $s
fi
$proot -b $HOME/.nix:/nix $0 $cmd
export IN_PROOT=
exit
elif ! [ $# -eq 0 ]; then
exec $cmd
fi

BIN
proot-x86_64 Executable file

Binary file not shown.