-
-
Save navigaid/d0bd0b2275719704cc28dd4b7df36336 to your computer and use it in GitHub Desktop.
Installation script for Nix on ChromeOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo mount -o remount,exec /tmp | |
if [ -x /usr/local/nixstrap/proot-x86_64 ] && [ -h ~/.nix-profile ]; then | |
echo "Launching shell with nix-* tools!" | |
exec /usr/local/nixstrap/proot-x86_64 -b /usr/local/nixstrap/nix-1.8-x86_64-linux:/nix bash --init-file ~/.nix-profile/etc/profile.d/nix.sh | |
fi | |
set -e | |
set -x | |
sudo mkdir -p /usr/local/nixstrap | |
sudo chown chronos:chronos /usr/local/nixstrap | |
cd /usr/local/nixstrap | |
NIX_TAR=nix-1.8-x86_64-linux.tar.bz2 | |
wget -O $NIX_TAR http://hydra.nixos.org/build/17897595/download/1/$NIX_TAR | |
tar xvf $NIX_TAR | |
rm $NIX_TAR | |
wget -O proot-x86_64 http://static.proot.me/proot-x86_64 | |
chmod u+x proot-x86_64 | |
./proot-x86_64 -b nix-1.8-x86_64-linux:/nix /nix/install | |
set +x | |
echo "Installation successful." | |
echo "Run this script again to gain access to the Nix tools." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment