Skip to content

Instantly share code, notes, and snippets.

@peterromfeldhk
Created May 10, 2021 00:00
Show Gist options
  • Save peterromfeldhk/f3a11b8fd051d523ad4932cef3089e76 to your computer and use it in GitHub Desktop.
Save peterromfeldhk/f3a11b8fd051d523ad4932cef3089e76 to your computer and use it in GitHub Desktop.
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p curl bash nix
set -euxo pipefail
commit_sha=$1
digest=$(nix-prefetch-url --unpack "https://github.com/NixOS/nixpkgs/archive/${commit_sha}.tar.gz")
echo "{\"rev\": \"${commit_sha}\", \"sha256\": \"${digest}\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment