#!/usr/bin/env bash function usage { echo "usage: nixpkgs-pin " echo "where is a git sha from the nixpkgs repo" exit 1 } [[ -z $1 ]] && usage url="https://github.com/NixOS/nixpkgs/archive/$1.tar.gz" hash=$(nix-prefetch-url --unpack $url) cat <