Skip to content

Use hackage.nix/index-state.nix #2392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
url = "github:input-output-hk/hackage.nix/for-stackage";
flake = false;
};
hackage-internal = {
url = "github:input-output-hk/hackage.nix";
flake = false;
};
stackage = {
url = "github:input-output-hk/stackage.nix";
flake = false;
Expand Down
12 changes: 9 additions & 3 deletions overlays/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ final: prev: {
# If you want to update this value it important to check the
# materializations. Turn `checkMaterialization` on below and
# check the CI results before turning it off again.
internalHackageIndexState = "2024-10-17T00:00:00Z"; # Remember to also update ../nix-tools/cabal.project and ../nix-tools/flake.lock

internalHackageIndexState = builtins.head (builtins.attrNames (
import (sources.hackage-internal + "/index-state.nix")));
checkMaterialization = false; # This is the default. Use an overlay to set it to true and test all the materialized files

# Helps materialize the output of derivations
Expand Down Expand Up @@ -601,7 +601,13 @@ final: prev: {
# Takes a haskell src directory runs cabal new-configure and plan-to-nix.
# Resulting nix files are added to nix-plan subdirectory.
callCabalProjectToNix = import ../lib/call-cabal-project-to-nix.nix {
index-state-hashes = import indexStateHashesPath;
index-state-hashes =
(
if builtins.pathExists (hackageSrc + "/index-state.nix")
then import (hackageSrc + "/index-state.nix")
else import (hackageSrc + "/index-state-hashes.nix")
)
// import (sources.hackage-internal + "/index-state.nix");
inherit (final.buildPackages.haskell-nix) haskellLib;
pkgs = final.buildPackages.pkgs;
inherit (final.buildPackages.pkgs) cacert;
Expand Down
Loading