Skip to content

haskell.nix: eliminate the allow-import-from-derivation requirement - #107

Open
tomberek wants to merge 2 commits into
masterfrom
haskell-nix-materialize
Open

tomberek wants to merge 2 commits into
masterfrom
haskell-nix-materialize

Conversation

@tomberek

Copy link
Copy Markdown
Collaborator

Summary

  • Uses ghcOverride to point at nixpkgs' prebuilt GHC instead of building haskell.nix's own patched GHC from source via hadrianProject, which needs IFD to evaluate regardless of GHC version or materialization (verified directly against haskell.nix's own flake, independent of this template).
  • Materializes the project's own cabal plan (haskell.nix/materialized/plan.nix).
  • Pins haskellNix to a revision whose nixpkgs-unstable still has spdx-license-list-data 3.27.0, matching haskell.nix's last materialized SPDX cache (newer nixpkgs-unstable ships 3.28.0, which haskell.nix hasn't materialized yet).
  • Drops the mingwW64 (Windows) cross-compilation target: haskell.nix's materialized iserv-proxy doesn't cover ghc966/ghc967 yet, so it falls back to an unmaterialized IFD build. The musl64 target is unaffected and kept.

allow-import-from-derivation = true is no longer needed for this template specifically, though it stays enabled globally in CI since haskell-flake (a different, callCabal2nix-based mechanism) still requires it.

Test plan

  • nix flake check --option allow-import-from-derivation false passes with zero IFD errors
  • nix flake show --option allow-import-from-derivation false passes
  • nix build --option allow-import-from-derivation false .#default builds and runs the executable successfully
  • Confirm CI (GitHub Actions, real Nix 2.35.2 install) passes too

Uses ghcOverride to point at nixpkgs' prebuilt GHC instead of letting
haskell-nix.compiler.* build its own patched GHC from source via
hadrianProject, which needs IFD to evaluate regardless of GHC version
or materialization (verified directly against haskell.nix's own flake).

Also materializes the project's own cabal plan (haskell.nix/materialized/
plan.nix) and pins haskellNix to a revision whose nixpkgs-unstable still
has spdx-license-list-data 3.27.0, matching haskell.nix's last
materialized SPDX cache — newer nixpkgs-unstable ships 3.28.0, which
haskell.nix hasn't materialized yet.

Drops the mingwW64 (Windows) cross-compilation target: haskell.nix's
materialized iserv-proxy (needed for cross-compiled TemplateHaskell
support) doesn't cover ghc966/ghc967, so it falls back to an
unmaterialized IFD build. The musl64 target is unaffected and kept.

allow-import-from-derivation = true is no longer needed for this
template specifically, though it stays enabled globally in CI since
haskell-flake (a different mechanism, callCabal2nix-based) still
requires it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tomberek
tomberek marked this pull request as draft September 14, 2026 05:25
builder/default.nix's hoogleLocal reads ghc.buildGHC unconditionally
(not ghc.buildGHC or ghc, unlike other call sites), which nixpkgs' plain
GHC lacks, breaking hydraJobs.x86_64-unknown-linux-musl. Point buildGHC
at itself to match what haskell.nix's own compilers carry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tomberek
tomberek marked this pull request as ready for review September 14, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant