Skip to content

Instantly share code, notes, and snippets.

@colstrom
Last active September 29, 2015 16:57
Show Gist options
  • Select an option

  • Save colstrom/cc1029884a750740c97a to your computer and use it in GitHub Desktop.

Select an option

Save colstrom/cc1029884a750740c97a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
ARCHIVE=nix_1.10-1_amd64.deb
CHECKSUM=b284d26ca9ee57f90ce9a3eca1a8eae19243927491e374ac3a1322af7db07378
function resolve-dependencies {
apt-get --assume-yes install \
libdbd-sqlite3-perl \
libwww-curl-perl xz-utils \
software-properties-common
}
function download {
curl --output "${ARCHIVE}" "https://hydra.nixos.org/build/25489757/download/1/${ARCHIVE}"
}
function verify {
echo "${CHECKSUM} ${ARCHIVE}" > "/tmp/${ARCHIVE}.checksum"
shasum --check "${ARCHIVE}.checksum"
}
function install {
sudo dpkg --install "${ARCHIVE}"
}
function install-nix {
resolve-dependencies && download && verify && install
}
install-nix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment