diff --git a/flake.lock b/flake.lock index 03b81be2a..835fddc39 100644 --- a/flake.lock +++ b/flake.lock @@ -120,11 +120,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1750292855, - "narHash": "sha256-fI06UmPtWs+lZy6aKE4nBKDWRKJeJr8s+qUAQgvpwCM=", + "lastModified": 1750307553, + "narHash": "sha256-iiafNoeLHwlSLQTyvy8nPe2t6g5AV4PPcpMeH/2/DLs=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "87d047843ca7b233a428e550c68e6b5faaaa8008", + "rev": "f7867baa8817fab296528f4a4ec39d1c7c4da4f3", "type": "github" }, "original": { @@ -150,6 +150,22 @@ "type": "github" } }, + "hackage-internal": { + "flake": false, + "locked": { + "lastModified": 1750307553, + "narHash": "sha256-iiafNoeLHwlSLQTyvy8nPe2t6g5AV4PPcpMeH/2/DLs=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "f7867baa8817fab296528f4a4ec39d1c7c4da4f3", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, "hls": { "flake": false, "locked": { @@ -527,6 +543,7 @@ "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hackage-for-stackage": "hackage-for-stackage", + "hackage-internal": "hackage-internal", "hls": "hls", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", diff --git a/flake.nix b/flake.nix index a28bd6abb..54723b2b8 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/overlays/haskell.nix b/overlays/haskell.nix index 01a15ecdc..1f3b46861 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -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 @@ -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;