Skip to content

Commit

Permalink
Add nix-bootstrap.sh script.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Apr 30, 2017
1 parent 1b9cffd commit 9116aae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions nix-bootstrap.sh
@@ -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
Binary file added proot-x86_64
Binary file not shown.

0 comments on commit 9116aae

Please sign in to comment.