git.iko.soy/typeable/cabal2nix
on v2.12 help sign in
typeable/cabal2nix/update-hackage-snapshot.sh
19 lines 589 B history raw
1#! /usr/bin/env bash
3set -eu -o pipefail
5rev=$( git ls-remote --heads git://github.com/commercialhaskell/all-cabal-hashes.git hackage \
6 | cut -f1
7 )
8url="https://github.com/commercialhaskell/all-cabal-hashes/archive/$rev.tar.gz"
9sha=$( nix-prefetch-url "$url" )
11sed -e "s|url = .*;|url = \"$url\";|" \
12 -e "s|sha256 = .*;|sha256 = \"$sha\";|" \
13 -i nixpkgs/pkgs/data/misc/hackage/default.nix
15cat <<EOF
16Verify that the new snapshot actually works:
18nix-build --no-out-link -E 'with (import ./nixpkgs {}); haskellPackages.callHackage "hsdns" "1.7.1" {}'
19EOF