Skip to content

Commit

Permalink
maintainers/…/regenerate-hackage-packages.sh: overrideable hackage2nix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sternenseemann committed Jun 5, 2021
1 parent 24a4c65 commit 1e73515
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maintainers/scripts/haskell/regenerate-hackage-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand Down

0 comments on commit 1e73515

Please sign in to comment.