@@ -0,0 +1,36 @@
1+{ stdenv, writeScriptBin, coreutils, git, nix-tools, cabal-install, nix-prefetch-git }:
5+writeScriptBin "update-hackage-nix" ''
10+ export PATH="${makeBinPath [ coreutils git nix-tools cabal-install nix-prefetch-git ]}"
12+ # Make sure the hackage index is recent.
15+ if [ -d hackage.nix ]; then
20+ git clone git@github.com:input-output-hk/hackage.nix.git
23+ hackage-to-nix hackage.nix
27+ git commit --allow-empty -m "Automatic update for $(date)"
29+ rev=$(git rev-parse HEAD)
35+ nix-prefetch-git https://github.com/input-output-hk/hackage.nix.git --rev "$rev" | tee hackage-src.json