Skip to content

Instantly share code, notes, and snippets.

@rayantony
Forked from puffnfresh/chromebook-nix.sh
Created February 2, 2017 11:46
Show Gist options
  • Save rayantony/b4ce843431791ce3a29cc4bbc04d89ab to your computer and use it in GitHub Desktop.
Save rayantony/b4ce843431791ce3a29cc4bbc04d89ab to your computer and use it in GitHub Desktop.
Installation script for Nix on ChromeOS
#!/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