on master help sign in
Add nix-bootstrap.sh script.
commit9116aae7b86b126f3040c92060a4a3549f3a7224 authorMatthew Bauer <mjbauer95@gmail.com> dateSun 30 Apr 2017, 15:48 (9 years ago) parent1b9cffd
2 files changed+31
nix-bootstrap.sh+31 proot-x86_64
nix-bootstrap.shnew file+31
@@ -0,0 +1,31 @@
1+#!/bin/sh
2+
3+cmd=sh
4+if ! [ $# -eq 0 ]; then
5+ cmd=$@
6+fi
7+
8+# should download this in the future
9+# but the mirror is down
10+proot=`dirname $0`/proot-`uname -p`
11+export PROOT_NO_SECCOMP=1
12+
13+if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
14+
15+if [ -z "$IN_PROOT" ]; then
16+ export IN_PROOT=1
17+
18+ if ! [ -d $HOME/.nix ]; then
19+ mkdir -p $HOME/.nix
20+ s=$(mktemp)
21+ curl https://nixos.org/nix/install -o $s
22+ $proot -b $HOME/.nix:/nix $0 sh $s
23+ fi
24+
25+ $proot -b $HOME/.nix:/nix $0 $cmd
26+
27+ export IN_PROOT=
28+ exit
29+elif ! [ $# -eq 0 ]; then
30+ exec $cmd
31+fi
proot-x86_64new file

Binary file not shown.