bash
sgdisk -o -a 2 -n 1:34:2047 -t 1:ef02 -c 1:bios-boot -a 2048 \
-n 2:2048:256M -t 2:8200 -c 2:swap \
-N 3 -t 3:8304 -c 3:root \
-G /dev/sda
mkswap -Lswap /dev/sda2
swapon /dev/sda2
mkfs.btrfs -Lroot /dev/sda3
mount -o compress /dev/sda3 /mnt
mount -o remount,size=256M /tmp
mount -t tmpfs -o size=256M tmpfs /var/empty
groupadd -r -g 30000 nixbld
useradd -c "Nix build user 1" -u 30001 -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" nixbld1
usermod -s "$(which bash)" nixbld1
mkdir -m 0755 /mnt/nixtmp && chown nixbld1:nixbld /mnt/nixtmp
ln -sv /mnt/nixtmp /nix
su - nixbld1
export LANG=POSIX
export LC_ALL=POSIX
export NIX_IGNORE_SYMLINK_STORE=1
bash <(curl https://nixos.org/nix/install)
. /var/empty/.nix-profile/etc/profile.d/nix.sh
nix-channel --remove nixpkgs
nix-channel --add http://nixos.org/channels/nixos-17.03-small nixos
nix-channel --update
tee configuration.nix <<<'{fileSystems."/" = {};boot.loader.grub.enable = false;}'
export NIX_PATH=nixpkgs=/var/empty/.nix-defexpr/channels/nixos:nixos=/var/empty/.nix-defexpr/channels/nixos/nixos
export NIXOS_CONFIG=/var/empty/configuration.nix
nix-env -i -A config.system.build.nixos-install -A config.system.build.nixos-option -A config.system.build.nixos-generate-config -f "<nixos>"
exit
bash
export LANG=POSIX
export LC_ALL=POSIX
. /var/empty/.nix-profile/etc/profile.d/nix.sh
nixos-generate-config --root /mnt
cat <<EOF > /mnt/etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];
  boot.loader.grub.enable = true;
  boot.loader.grub.version = 2;
  boot.loader.grub.device = "/dev/sda";
  services.openssh.enable = true;
}
EOF
export NIX_PATH=nixpkgs=/var/empty/.nix-defexpr/channels/nixos:nixos=/var/empty/.nix-defexpr/channels/nixos/nixos
export NIX_IGNORE_SYMLINK_STORE=1
sync; sysctl -w vm.drop_caches=3
nixos-install
nixos-install --chroot $(ls -1 /nix/store/*/bin/bash | head -1)

This page contains copy-and-paste-able instructions to install NixOS from System Rescue CD, based on this nixaid blog post.