Skip to content

Move third-party Haskell overrides to digitallyinduced/nixpkgs fork#2624

Open
mpscholten wants to merge 5 commits intomasterfrom
feature/nixpkgs-fork
Open

Move third-party Haskell overrides to digitallyinduced/nixpkgs fork#2624
mpscholten wants to merge 5 commits intomasterfrom
feature/nixpkgs-fork

Conversation

@mpscholten
Copy link
Copy Markdown
Member

@mpscholten mpscholten commented Apr 9, 2026

Summary

  • Switches the nixpkgs flake input to digitallyinduced/nixpkgs:ihp-nixpkgs, a snapshot of upstream/haskell-updates that already carries every Hackage package IHP needs (hasql 1.10 stack, hasql-mapping, postgresql-types family, temporary-ospath, wai-session-maybe, countable-inflections 0.3.2, ptr-peeker unbroken, hasql-interpolate with cabal-revisioned hasql 1.10 support).
  • Shrinks NixSupport/overlay.nix by ~70 lines: deletes the third-party block, deletes the unused hackageOrLocal helper, and replaces it with a small rebind block pointing haskellPackages.hasql etc. at the fork's version-suffixed attributes.
  • Removes 17 NixSupport/hackage/*.nix files. Only ihp-zip.nix stays (IHP-maintained fork of zip, not on Hackage). update-nix-from-cabal.sh's third-party loop is deleted accordingly.

Why

The pre-generated NixSupport/hackage/ approach worked but was a footgun magnet: adding a new Hackage dep via callHackage (IFD) would silently break nix caching, and nothing in the structure prevented it. Pushing these overrides into a nixpkgs fork means there is no longer a place in IHP's own overlay where it would even be tempting to reach for callHackage. New third-party deps now go through the fork.

nixpkgs-nixos stays on nixos-25.11 — only the Haskell-package input switches.

Fork contents

Branch ihp-nixpkgs in digitallyinduced/nixpkgs is a direct snapshot of NixOS/nixpkgs:haskell-updates at c11132a13656. No IHP-specific commits sit on top — every override IHP needs is already in upstream haskell-updates from previously-merged PRs. To bump the snapshot: fast-forward ihp-nixpkgs to a newer haskell-updates tip and nix flake update nixpkgs.

Verification

Ran with nix eval --no-allow-import-from-derivation:

Target Result
.#packages.aarch64-darwin.default clean
.#packages.aarch64-darwin.ihp-datasync clean
.#packages.aarch64-darwin.ihp-typed-sql clean
.#packages.aarch64-darwin.ihp-pglistener clean
.#packages.aarch64-darwin.migrate clean
.#checks.aarch64-darwin.ghc912-ihp-datasync clean
.#checks.aarch64-darwin (attr eval) clean, 95 checks

The pre-existing yarn.nix IFD in .#checks.aarch64-darwin.guide (via pkgs.mkYarnModules) is unrelated — NixSupport/default.nix:416 wasn't touched and the baseline had the same state.

Test plan

  • CI runs nix flake check --impure against default GHC (9.10) and GHC 9.12
  • nix develop works and ghc-pkg list hasql shows 1.10.3
  • ghc-pkg list postgresql-types shows 0.1.2
  • Cachix populates for the new hasql stack (otherwise developers pay the first-build cost locally)

🤖 Generated with Claude Code

Switch the nixpkgs flake input to a digitallyinduced/nixpkgs fork that
snapshots upstream/haskell-updates, which already carries every package
IHP needs from the upstream PRs previously pushed: hasql 1.10 stack,
hasql-mapping, postgresql-types (nikita-volkov family), temporary-ospath,
wai-session-maybe, wai-session-clientsession-deferred, countable-inflections
0.3.2, ptr-peeker unbroken, and hasql-interpolate with the cabal-revisioned
hasql 1.10 support.

NixSupport/overlay.nix shrinks ~70 lines: the entire third-party hackage
block is gone, as is the unused hackageOrLocal helper. In its place, a
small rebind block points haskellPackages.hasql etc. at the
version-suffixed attrs (hasql_1_10_3, hasql-pool_1_4_2, ...) the fork
ships as extra-packages. Postgrest is unaffected because its own
overrideScope in configuration-common.nix pins to super.hasql_1_6_4_4.

NixSupport/hackage/ now holds only ihp-zip.nix (the IHP-maintained fork
of zip that doesn't live on Hackage). update-nix-from-cabal.sh's
third-party section is deleted accordingly.

Structural benefit: the IFD foot-gun is gone. There is no longer any
place in the overlay where adding a new Hackage dep via callHackage
would be tempting — new deps must come through the fork.

Verified IFD-free with --no-allow-import-from-derivation on ihp,
ihp-datasync, ihp-typed-sql, ihp-pglistener, ihp-migrate, and
ghc912-ihp-datasync. The pre-existing yarn.nix IFD in the guide check
(via mkYarnModules) is unrelated and untouched.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

# Conflicts:
#	update-nix-from-cabal.sh
@mpscholten mpscholten force-pushed the feature/nixpkgs-fork branch from 81000a2 to 84bda28 Compare April 9, 2026 11:39
mpscholten and others added 4 commits April 9, 2026 13:52
Picks up ~200 commits of upstream haskell-updates progression since the
initial snapshot at c11132a13656. IFD-free eval re-verified on ihp,
ihp-datasync, and ghc912-ihp-datasync.

ihp-zip is not yet in hackage-packages.nix in this snapshot either, so
NixSupport/hackage/ihp-zip.nix remains. Will be removable in a follow-up
after nixpkgs's next hackage2nix regeneration catches up to Hackage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The haskell-updates snapshot ships tls 2.1.8 whose test suite has 4
flaky TLS 1.3 PSK handshake property tests ("handshake can handshake
with TLS 1.3 PSK", "... PSK ticket", "... 0RTT") that fail under nix
check phase on aarch64-darwin. They blocked the whole nix flake check
graph via transitive dep.

dontCheck is the same remedy used for say/text-icu/cryptonite in the
per-GHC 9.12 / 9.14 blocks. IHP doesn't exercise the failing code
paths directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
devenv-module.nix was using pkgs.haskellPackages.mmark-cli, which
bypasses the overlay defined in NixSupport/overlay.nix. That meant the
tls = dontCheck super.tls override added in ed609ab only applied to
pkgs.ghc.* and pkgs.ghc912.*, but not to mmark-cli's transitive tls
dep — so the flaky tls 2.1.8 test suite still ran during CI and still
killed the whole graph.

Switching to pkgs.ghc.mmark-cli makes mmark-cli pull in the overridden
tls (with dontCheck), unblocking CI. pkgs.ghc is the full overlay-
aware haskellPackages set (created via haskellPackages.override), so
any package not explicitly overridden is still the default version.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The nixpkgs fork (haskell-updates snapshot) now ships ghc-9.14.1, which
flipped `pkgs.haskell.packages ? ghc914` from false to true and started
gating CI on 35+ ghc914-* package checks. They all fail on the first
transitive dep that still upper-bounds ghc <9.13 — in this run,
ghc-tcplugins-extra-0.5.

The original intent of the conditional was "only check ghc914 if
nixpkgs includes it" — assuming that would gate on whether upstream
had merged 9.14 support. In practice the ecosystem lags behind the
compiler: nixpkgs ships 9.14 before downstream deps support it.

Keeping overlay.nix's ghc914 branch (opt-in for anyone who wants to
try it), just not gating CI on it. When the ecosystem catches up we
can re-enable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Core Size & Compile Allocations Benchmark

Metric Baseline (master) This PR Change
Core size 11346663 bytes 11332069 bytes -0.1%
Compile allocations 27761166136 bytes 27759533184 bytes -0.0%

Core size within threshold
Compile allocations within threshold

HTTP Latency (GET /, 5000 reqs, 10 concurrent)

Metric Baseline (master) This PR Change
Mean 3.39ms 3.45ms 1.8%
p50 3.30ms 3.30ms
p99 6.60ms 6.00ms
Min 0.60ms 0.60ms
Max 59.60ms 58.20ms
Req/s 2884 2879

HTTP latency within threshold

Top 10 modules (this PR)

Module Size (bytes)
Web.Types.thr 547347
Web.FrontController.thr 428365
Web.Routes.thr 423670
Web.View.Threads.Show.thr 325442
Web.Controller.Threads.thr 322642
Web.Controller.Comments.thr 315263
Web.Controller.Users.thr 284157
Admin.FrontController.thr 276489
Admin.Types.thr 264263
build.Generated.User.thr 259731

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