maintainers/…/regenerate-hackage-packages.sh: overrideable hackage2nix

Allow setting the HACKAGE2NIX environment variable to change the
hackage2nix the script uses to an absolute path to a local build. Useful
to test local changes in a realistic environment.
master
sternenseemann 2021-06-05 16:08:32 +02:00 committed by sterni
parent 24a4c65ca9
commit 1e7351550c
1 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,8 @@
set -euo pipefail
HACKAGE2NIX="${HACKAGE2NIX:-hackage2nix}"
# To prevent hackage2nix fails because of encoding.
# See: https://github.com/NixOS/nixpkgs/pull/122023
export LC_ALL=C.UTF-8
@ -23,7 +25,7 @@ unpacked_hackage="$(nix-build -E "$extraction_derivation" --no-out-link)"
config_dir=pkgs/development/haskell-modules/configuration-hackage2nix
echo "Starting hackage2nix to regenerate pkgs/development/haskell-modules/hackage-packages.nix ..."
hackage2nix \
"$HACKAGE2NIX" \
--hackage "$unpacked_hackage" \
--preferred-versions <(for n in "$unpacked_hackage"/*/preferred-versions; do cat "$n"; echo; done) \
--nixpkgs "$PWD" \