2018-09-17 16:00:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This downloads and installs a pinned version of nix
|
|
|
|
set -ex
|
|
|
|
|
2020-11-28 09:32:15 +00:00
|
|
|
NIX_VERSION="2.3.9"
|
2023-01-01 15:52:19 +00:00
|
|
|
if [ "$NIX_ARCH" = "aarch64" ]; then
|
|
|
|
NIX_SHA256="733a26911193fdd44d5d68342075af5924d8c0701aae877e51a38d74ee9f4ff8"
|
|
|
|
else
|
|
|
|
NIX_SHA256="49763fd7fa06bcb712ced2f3f11afd275e3a4d7bc5ff0d6fd1d50a4c3ce7bbf4"
|
|
|
|
fi
|
2018-09-17 16:00:23 +00:00
|
|
|
|
2018-12-18 21:06:33 +00:00
|
|
|
# Do all our operations in /tmp, since we can't rely on current directory being writeable yet.
|
|
|
|
cd /tmp
|
2023-01-01 15:52:19 +00:00
|
|
|
wget --quiet https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-$NIX_ARCH-linux.tar.xz
|
|
|
|
echo "$NIX_SHA256 nix-$NIX_VERSION-$NIX_ARCH-linux.tar.xz" | sha256sum -c
|
|
|
|
tar xJf nix-*-$NIX_ARCH-linux.tar.xz
|
|
|
|
sh nix-*-$NIX_ARCH-linux/install
|
|
|
|
rm -r nix-*-$NIX_ARCH-linux*
|