on master help sign in
Configurable nixdir location
7f0418dMatthew Bauer
nix-bootstrap.sh+8−4
@@ -10,19 +10,23 @@ fi
10proot=`dirname $0`/proot-`uname -p`
10proot=`dirname $0`/proot-`uname -p`
11export PROOT_NO_SECCOMP=1
11export PROOT_NO_SECCOMP=1
12
12
13+nixdir=$HOME/.nix
14+
15+OLD_NIX_PATH=$NIX_PATH
13if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
16if [ -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
14
18
15if [ -z "$IN_PROOT" ]; then
19if [ -z "$IN_PROOT" ]; then
16 export IN_PROOT=1
20 export IN_PROOT=1
17
21
18− if ! [ -d $HOME/.nix ]; then
22+ if ! [ -d $nixdir ]; then
19− mkdir -p $HOME/.nix
23+ mkdir -p $nixdir
20 s=$(mktemp)
24 s=$(mktemp)
21 curl https://nixos.org/nix/install -o $s
25 curl https://nixos.org/nix/install -o $s
22− $proot -b $HOME/.nix:/nix $0 sh $s
26+ $proot -b $nixdir:/nix $0 sh $s
23 fi
27 fi
24
28
25− $proot -b $HOME/.nix:/nix $0 $cmd
29+ $proot -b $nixdir:/nix $0 $cmd
26
30
27 export IN_PROOT=
31 export IN_PROOT=
28 exit
32 exit