2020-03-06 16:52:05 +03:00
|
|
|
{ stdenv, writeScript, coreutils, glibc, git, openssh
|
|
|
|
, nix-tools, cabal-install, nix-prefetch-git
|
|
|
|
, gawk, bash, curl, findutils
|
|
|
|
, update-index-state-hashes }@args:
|
2019-02-08 03:45:02 +03:00
|
|
|
|
2019-06-15 08:16:52 +03:00
|
|
|
import ./update-external.nix
|
|
|
|
(removeAttrs args ["update-index-state-hashes"]) {
|
2019-02-11 06:37:10 +03:00
|
|
|
name = "hackage";
|
|
|
|
script = ''
|
|
|
|
# Clone or update the Hackage Nix expressions repo.
|
|
|
|
if [ -d hackage.nix ]; then
|
|
|
|
cd hackage.nix
|
|
|
|
git pull --ff-only
|
|
|
|
cd ..
|
|
|
|
else
|
|
|
|
git clone git@github.com:input-output-hk/hackage.nix.git
|
|
|
|
fi
|
2019-02-08 03:45:02 +03:00
|
|
|
|
2019-06-24 13:32:33 +03:00
|
|
|
set -x
|
2019-02-13 08:18:19 +03:00
|
|
|
# Make sure the hackage index is recent.
|
|
|
|
echo "Updating local hackage index..."
|
|
|
|
cabal update
|
|
|
|
|
2019-02-11 06:37:10 +03:00
|
|
|
echo "Running hackage-to-nix..."
|
2019-02-08 03:45:02 +03:00
|
|
|
|
2019-02-11 06:37:10 +03:00
|
|
|
hackage-to-nix hackage.nix
|
2019-02-08 03:45:02 +03:00
|
|
|
|
2019-06-08 10:21:02 +03:00
|
|
|
echo "Running update-index-state-hashes..."
|
|
|
|
|
2019-02-08 03:45:02 +03:00
|
|
|
cd hackage.nix
|
2019-06-24 13:32:33 +03:00
|
|
|
|
|
|
|
${update-index-state-hashes}/bin/update-index-state-hashes > index-state-hashes.nix
|
2019-02-11 06:37:10 +03:00
|
|
|
'';
|
|
|
|
}
|