on preflake help sign in
haskell.nix/scripts/update-hackage.nix
34 lines 863 B history raw
1{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
2, nix-tools, cabal-install, nix-prefetch-git
3, gawk, bash, curl, findutils
4, update-index-state-hashes }@args:
6import ./update-external.nix
7(removeAttrs args ["update-index-state-hashes"]) {
8 name = "hackage";
9 script = ''
10 # Clone or update the Hackage Nix expressions repo.
11 if [ -d hackage.nix ]; then
12 cd hackage.nix
13 git pull --ff-only
14 cd ..
15 else
16 git clone git@github.com:input-output-hk/hackage.nix.git
17 fi
19 set -x
20 # Make sure the hackage index is recent.
21 echo "Updating local hackage index..."
22 cabal update
24 echo "Running hackage-to-nix..."
26 hackage-to-nix hackage.nix
28 echo "Running update-index-state-hashes..."
30 cd hackage.nix
32 ${update-index-state-hashes}/bin/update-index-state-hashes > index-state-hashes.nix
33 '';