From 1e7351550cf05f2c467c240ea93b245a2b6bf7c2 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 5 Jun 2021 16:08:32 +0200 Subject: [PATCH] =?UTF-8?q?maintainers/=E2=80=A6/regenerate-hackage-packag?= =?UTF-8?q?es.sh:=20overrideable=20hackage2nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- maintainers/scripts/haskell/regenerate-hackage-packages.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" \