diff --git a/etc/nix/flake.nix b/etc/nix/flake.nix index 62c916c08..22081e9b2 100644 --- a/etc/nix/flake.nix +++ b/etc/nix/flake.nix @@ -50,12 +50,12 @@ # Pin pypi repo to a specific commit which includes all necessary # Python deps. The default version (which is updated with every - # mach-nix release) is insufficient. - # The corresponding sha256 hash can be obtained with: - # $ nix-prefetch-url --unpack https://github.com/DavHau/pypi-deps-db/tarball/ - pypiDataRev = "fb3c23d059d64e81539fa317635bbe241ba4531e"; + # mach-nix release) is usually insufficient. Use + # ./get-latest-pypi-deps-db.sh to obtain the data rev & hash. + pypiDataRev = + "894c2005d655011934c04d150f8c57d25a25e29d"; # 2021-03-04T20:10:42Z pypiDataSha256 = - "168zc3a0z1flgk3srhyf4z6379f37ka5d6z1c1h3hr2agllr7rmc"; + "1y6297drhbv34da1rjwp01s8wwwqkwxjsq3rkjcdqy69w4r987rz"; }); in { diff --git a/etc/nix/get-latest-pypi-deps-db.sh b/etc/nix/get-latest-pypi-deps-db.sh new file mode 100755 index 000000000..7506499bb --- /dev/null +++ b/etc/nix/get-latest-pypi-deps-db.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +USER_SLASH_REPO="DavHau/pypi-deps-db" + +DATA=$(curl "https://api.github.com/repos/$USER_SLASH_REPO/commits/master" | jq '.sha, .commit.author.date' | sed 's/"//g') +COMMIT=$(sed '1q;d' <<< "$DATA") +DATE=$(sed '2q;d' <<< "$DATA") +SHA256=$(nix-prefetch-url --unpack --type sha256 "https://github.com/$USER_SLASH_REPO/tarball/$COMMIT" | tail -n 1) + +echo "" +echo "pypiDataRev = \"$COMMIT\"; # $DATE" +echo "pypiDataSha256 = \"$SHA256\";"