forked from input-output-hk/haskell.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-hackage.nix
34 lines (27 loc) · 856 Bytes
/
update-hackage.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, lib, writeScript, coreutils, glibc, git, openssh
, nix-tools, cabal-install, nixFlakes
, gawk, bash, curl, findutils
, update-index-state-hashes }@args:
import ./update-external.nix
(removeAttrs args ["update-index-state-hashes"]) {
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 [email protected]:input-output-hk/hackage.nix.git
fi
set -x
# Make sure the hackage index is recent.
echo "Updating local hackage index..."
cabal update
echo "Running hackage-to-nix..."
hackage-to-nix hackage.nix
echo "Running update-index-state-hashes..."
cd hackage.nix
${update-index-state-hashes}/bin/update-index-state-hashes > index-state-hashes.nix
'';
}