on 2e49d28 help sign in
haskell.nix/scripts/update-hackage.nix
30 lines 817 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 # Make sure the hackage index is recent.
17 echo "Updating local hackage index..."
18 cabal update
20 echo "Running hackage-to-nix..."
22 hackage-to-nix hackage.nix
24 echo "Running update-index-state-hashes..."
26 ${update-index-state-hashes}/bin/update-index-state-hashes > ./index-state-hashes.nix
28 cd hackage.nix
29 '';