Created
June 24, 2022 21:07
-
-
Save mkohler/ca61111515f70b0575d66d7f51b4d6c6 to your computer and use it in GitHub Desktop.
Create a github archive link for the current version of nixpkgs
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
#!/bin/sh | |
# Get the current version, and then use tr to remove double-quotes. | |
version=$(nix-instantiate --eval --attr 'lib.version' '<nixpkgs>' | tr -d '"') | |
# The version is in the form YY.MM.NUM.HASH. We just want the 4th field. | |
commit_hash=$(echo ${version} | cut -d '.' -f4) | |
echo "https://github.com/NixOS/nixpkgs/archive/${commit_hash}.tar.gz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment