on 147cf21 help sign in
haskell.nix/scripts/update-hackage.nix
31 lines 826 B history raw
1{ stdenv, writeScript, coreutils, glibc, git, openssh, nix-tools, cabal-install, nix-prefetch-git, update-index-state-hashes }@args:
3import ./update-external.nix
4(removeAttrs args ["update-index-state-hashes"]) {
5 name = "hackage";
6 script = ''
7 # Clone or update the Hackage Nix expressions repo.
8 if [ -d hackage.nix ]; then
9 cd hackage.nix
10 git pull --ff-only
11 cd ..
12 else
13 git clone git@github.com:input-output-hk/hackage.nix.git
14 fi
16 set -x
17 # Make sure the hackage index is recent.
18 echo "Updating local hackage index..."
19 cabal update
21 echo "Running hackage-to-nix..."
23 hackage-to-nix hackage.nix
25 echo "Running update-index-state-hashes..."
27 cd hackage.nix
29 ${update-index-state-hashes}/bin/update-index-state-hashes > index-state-hashes.nix
30 '';