mirror of
https://github.com/ilyakooo0/nix-bundle.git
synced 2024-10-05 19:17:16 +03:00
Add nix-bootstrap.sh script.
This commit is contained in:
parent
1b9cffd972
commit
9116aae7b8
31
nix-bootstrap.sh
Executable file
31
nix-bootstrap.sh
Executable 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
BIN
proot-x86_64
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user