Skip to content

Instantly share code, notes, and snippets.

@sveitser
Created July 31, 2018 05:36
Show Gist options
  • Save sveitser/13daf978708ba740a18071ae8c7192fb to your computer and use it in GitHub Desktop.
Save sveitser/13daf978708ba740a18071ae8c7192fb to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
url=$(curl https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz -s -L -I -o /dev/null -w '%{url_effective}')
echo Got tarball URL "$url"
sha=$(nix-prefetch-url --unpack "$url")
echo With SHA $sha
cat > shell.nix <<EOF
with import (
builtins.fetchTarball {
url = "$url";
sha256 = "$sha";
}
) { };
mkShell rec {
buildInputs = [
yarn
];
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment