forked from NixOS/nixos-homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
91 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[%- | ||
latestNixVersion = "2.0.2" | ||
nix_hash_i686_linux = "01d5da9fad80c3282c5c7d9a7913b505c4c789940d021a1b21cb49df8ae081f8" | ||
nix_hash_x86_64_linux = "d0c2492d7d8f824e3b1ace15a1a58f64a0a8faacc59936ebedfe18905d982d7c" | ||
nix_hash_aarch64_linux = "97397dad4c57031f2e5be37f49c8d610aa98620c971cf99eff8e4c8354d38615" | ||
nix_hash_x86_64_darwin = "3c22d1591b4b39c69054839311cb024ea531d8a57019ec18ff60449a596962a0" | ||
latestNixVersion = "2.0.3" | ||
nix_hash_i686_linux = "87de6838400ea76106213c1eadc056f10d031a5704fe65e8a6d850656104b741" | ||
nix_hash_x86_64_linux = "cb61eb05de2ea5fde825f4414d3a464bed91398e2ccae237a523368986547078" | ||
nix_hash_aarch64_linux = "d285adb60fc332f227ba6569bdde67253961f615b06603d043f1bee72c0c2ce1" | ||
nix_hash_x86_64_darwin = "5e4db50f410281e7e2d6662ab09278c9a234b4f4925017eaccae9d05191800f3" | ||
-%] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/sh | ||
|
||
# This script installs the Nix package manager on your system by | ||
# downloading a binary distribution and running its installer script | ||
# (which in turn creates and populates /nix). | ||
|
||
{ # Prevent execution if this script was only partially downloaded | ||
oops() { | ||
echo "$0:" "$@" >&2 | ||
exit 1 | ||
} | ||
|
||
tmpDir="$(mktemp -d -t nix-binary-tarball-unpack.XXXXXXXXXX || \ | ||
oops "Can\'t create temporary directory for downloading the Nix binary tarball")" | ||
cleanup() { | ||
rm -rf "$tmpDir" | ||
} | ||
trap cleanup EXIT INT QUIT TERM | ||
|
||
require_util() { | ||
type "$1" > /dev/null 2>&1 || which "$1" > /dev/null 2>&1 || | ||
oops "you do not have '$1' installed, which I need to $2" | ||
} | ||
|
||
case "$(uname -s).$(uname -m)" in | ||
Linux.x86_64) system=x86_64-linux; hash=cb61eb05de2ea5fde825f4414d3a464bed91398e2ccae237a523368986547078;; | ||
Linux.i?86) system=i686-linux; hash=87de6838400ea76106213c1eadc056f10d031a5704fe65e8a6d850656104b741;; | ||
Linux.aarch64) system=aarch64-linux; hash=d285adb60fc332f227ba6569bdde67253961f615b06603d043f1bee72c0c2ce1;; | ||
Darwin.x86_64) system=x86_64-darwin; hash=5e4db50f410281e7e2d6662ab09278c9a234b4f4925017eaccae9d05191800f3;; | ||
*) oops "sorry, there is no binary distribution of Nix for your platform";; | ||
esac | ||
|
||
url="https://nixos.org/releases/nix/nix-2.0.3/nix-2.0.3-$system.tar.bz2" | ||
|
||
tarball="$tmpDir/$(basename "$tmpDir/nix-2.0.3-$system.tar.bz2")" | ||
|
||
require_util curl "download the binary tarball" | ||
require_util bzcat "decompress the binary tarball" | ||
require_util tar "unpack the binary tarball" | ||
|
||
echo "downloading Nix 2.0.3 binary tarball for $system from '$url' to '$tmpDir'..." | ||
curl -L "$url" -o "$tarball" || oops "failed to download '$url'" | ||
|
||
if type sha256sum > /dev/null 2>&1; then | ||
hash2="$(sha256sum -b "$tarball" | cut -c1-64)" | ||
elif type shasum > /dev/null 2>&1; then | ||
hash2="$(shasum -a 256 -b "$tarball" | cut -c1-64)" | ||
elif type openssl > /dev/null 2>&1; then | ||
hash2="$(openssl dgst -r -sha256 "$tarball" | cut -c1-64)" | ||
else | ||
oops "cannot verify the SHA-256 hash of '$url'; you need one of 'shasum', 'sha256sum', or 'openssl'" | ||
fi | ||
|
||
if [ "$hash" != "$hash2" ]; then | ||
oops "SHA-256 hash mismatch in '$url'; expected $hash, got $hash2" | ||
fi | ||
|
||
unpack=$tmpDir/unpack | ||
mkdir -p "$unpack" | ||
< "$tarball" bzcat | tar -xf - -C "$unpack" || oops "failed to unpack '$url'" | ||
|
||
script=$(echo "$unpack"/*/install) | ||
|
||
[ -e "$script" ] || oops "installation script is missing from the binary tarball!" | ||
"$script" "$@" | ||
|
||
} # End of wrapping |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-----BEGIN PGP SIGNATURE----- | ||
|
||
iQEzBAABCAAdFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAlsOc0YACgkQgXC0cm1x | ||
mN4OCAgAzuSen5PDSHFJVgSecn12tH7kgdVLRcMC1HgbGX9QUz9EwiJGyQFy8Cu8 | ||
wSeLR7QKGw1PnP/i6XVlNutUPWYpISiuFWUko/FB/GxGs7EaIm7KmTyKLfTbGFac | ||
AHSVpYoNhQl0D2a+IWKpCh4Y5vnVUmH6eZIqN84fjZBhxL6+uJ7T7j4fuzrRluIl | ||
vETrVNsbCiPz+v29upYY/XRCjWGAqTzm45h8ZiIQ0FifXQj88ygAorPwXeI5/Y5X | ||
qTAUtkpStrzil5L+prDdE7ncM9eQ21nXdWkjlaDAylzmgy3xf8JboigZZ63gxMfI | ||
5vlyyiiceSlX97FcBqEwbTcjBoCYOA== | ||
=zvEo | ||
-----END PGP SIGNATURE----- |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
-----BEGIN PGP SIGNATURE----- | ||
|
||
iQEzBAABCAAdFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAlrsQ4IACgkQgXC0cm1x | ||
mN5mmggAneasEWKCpVxIIWdlwA+3lK6u0Ywi1WLDDqQxFF9ntdaylqpvRDCjsfTG | ||
/vy+Hr1qReZlhMboBb2kP5DKClzlrl6mfxSYxHr4hHbnwuxS4nSs5edKo+lU4EE3 | ||
30ABVyotiSPdA15AQGPPjPIj1cDMpEM2z02MgeR3acZ0+7gqQh3lv0GSADYh06eg | ||
mnecDz67CpwMoAXfjvygZwchltaFq2drAqv5WMOrmkCvgyX8gy6WcbLTLEcJE1De | ||
8Pw8VP/0+9IL29NmT12O7Z2mlMgCxLULGDg5RM1+C0oiF640Ow1Aok2KXeuykoPQ | ||
x9KKDkRyAquYrL3RdpG7pPgzLtrpGw== | ||
=lWLM | ||
iQEzBAABCAAdFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAlsOc0YACgkQgXC0cm1x | ||
mN4OCAgAzuSen5PDSHFJVgSecn12tH7kgdVLRcMC1HgbGX9QUz9EwiJGyQFy8Cu8 | ||
wSeLR7QKGw1PnP/i6XVlNutUPWYpISiuFWUko/FB/GxGs7EaIm7KmTyKLfTbGFac | ||
AHSVpYoNhQl0D2a+IWKpCh4Y5vnVUmH6eZIqN84fjZBhxL6+uJ7T7j4fuzrRluIl | ||
vETrVNsbCiPz+v29upYY/XRCjWGAqTzm45h8ZiIQ0FifXQj88ygAorPwXeI5/Y5X | ||
qTAUtkpStrzil5L+prDdE7ncM9eQ21nXdWkjlaDAylzmgy3xf8JboigZZ63gxMfI | ||
5vlyyiiceSlX97FcBqEwbTcjBoCYOA== | ||
=zvEo | ||
-----END PGP SIGNATURE----- |