diff --git a/maintainers/scripts/haskell/regenerate-hackage-packages.sh b/maintainers/scripts/haskell/regenerate-hackage-packages.sh index 1effa5e2596c9..e7f91f2d79d18 100755 --- a/maintainers/scripts/haskell/regenerate-hackage-packages.sh +++ b/maintainers/scripts/haskell/regenerate-hackage-packages.sh @@ -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" \