@@ -1,10 +1,8 @@
1−{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv }:
1+{ indexStateHashesPath, nix-tools, coreutils, nix, writeShellScriptBin, stdenv, curl }:
22with builtins;
33with stdenv.lib;
44writeShellScriptBin "update-index-state-hashes" ''
5− # get all the tools we need. I wonder if there is a better way? But I couldn't find
6− # any buildInputs for writeShellScriptBin :-/
7− export PATH="${getBin coreutils}/bin:${getBin nix-tools}/bin:${getBin nix}/bin:$PATH"
5+ export PATH="${makeBinPath [ coreutils nix-tools nix]}"
86
97 # We'll take the last element from the indexStatesHashes file via nix and get the name.
108 # This is the last timestamp recorded in the file (implicit assumption: the file is
@@ -31,7 +29,8 @@ writeShellScriptBin "update-index-state-hashes" ''
3129
3230 # ensure we don't generate the $start date twice (skip the first invocation).
3331 if [[ "''${dt}T00:00:00Z" != "$start" ]]; then
34− truncate-index -o ''${dt}-01-index.tar.gz -i ${fetchurl "https://hackage.haskell.org/01-index.tar.gz"} -s "''${dt}T00:00:00Z"
32+ curl "https://hackage.haskell.org/01-index.tar.gz" --output index.tar.gz --fail-early
33+ truncate-index -o ''${dt}-01-index.tar.gz -i index.tar.gz -s "''${dt}T00:00:00Z"
3534 sha256=$(nix-hash --flat --type sha256 ''${dt}-01-index.tar.gz)
3635 echo " \"''${dt}T00:00:00Z\" = \"''${sha256}\";"
3736 fi