forked from mirrors/nixpkgs
7f236bd4b2
We split configuration-hackage2nix.yaml into multiple files. We bump cabal2nix-unstable to get support for multiple config files in hackage2nix. * The file main.yaml is only supposed to be edited by humans. * The file stackage.yaml is only supposed to be updated by the update-stackage.sh * The file broken.yaml can be edited by humans, but probably future helpers will want to insert broken packages into this file based on hydra reports. * The file transitive-broken.yaml is newly introduced to be generated by regenerate-transitive-broken-packages.sh regenerate-transitive-broken-packages.sh makes a nix query (in transitive-broken-packages.nix) which evaluates all haskellPackages once with and once without "allowBroken" this way it get's a list of packages which are broken by some transitive dependency, but does not disable packages which have eval errors not caused by a broken package.
38 lines
1.6 KiB
Bash
Executable file
38 lines
1.6 KiB
Bash
Executable file
#! /usr/bin/env nix-shell
|
|
#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable git nix -I nixpkgs=.
|
|
|
|
# This script is used to regenerate nixpkgs' Haskell package set, using a tool
|
|
# called hackage2nix. hackage2nix looks at the config files in
|
|
# pkgs/development/haskell-modules/configuration-hackage2nix and generates
|
|
# a Nix expression for package version specified there, using the Cabal files
|
|
# from the Hackage database (available under all-cabal-hashes) and its
|
|
# companion tool cabal2nix.
|
|
#
|
|
# Related scripts are update-hackage.sh, for updating the snapshot of the
|
|
# Hackage database used by hackage2nix, and update-cabal2nix-unstable.sh,
|
|
# for updating the version of hackage2nix used to perform this task.
|
|
|
|
set -euo pipefail
|
|
|
|
extraction_derivation='with import ./. {}; runCommand "unpacked-cabal-hashes" { } "tar xf ${all-cabal-hashes} --strip-components=1 --one-top-level=$out"'
|
|
unpacked_hackage="$(nix-build -E "$extraction_derivation" --no-out-link)"
|
|
config_dir=pkgs/development/haskell-modules/configuration-hackage2nix
|
|
|
|
hackage2nix \
|
|
--hackage "$unpacked_hackage" \
|
|
--preferred-versions <(for n in "$unpacked_hackage"/*/preferred-versions; do cat "$n"; echo; done) \
|
|
--nixpkgs "$PWD" \
|
|
--config "$config_dir/main.yaml" \
|
|
--config "$config_dir/stackage.yaml" \
|
|
--config "$config_dir/broken.yaml" \
|
|
--config "$config_dir/transitive-broken.yaml"
|
|
|
|
if [[ "${1:-}" == "--do-commit" ]]; then
|
|
git add pkgs/development/haskell-modules/hackage-packages.nix
|
|
git commit -F - << EOF
|
|
hackage-packages.nix: Regenerate based on current config
|
|
|
|
This commit has been generated by maintainers/scripts/haskell/regenerate-hackage-packages.sh
|
|
EOF
|
|
fi
|