From e662243de815e77509bff29dd3256ea4cba4dbae Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 9 Feb 2026 23:06:59 -0500 Subject: [PATCH 1/2] Update flake inputs --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 1c548f3..8f5e7d9 100644 --- a/flake.lock +++ b/flake.lock @@ -87,11 +87,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1769115329, - "narHash": "sha256-hiZ/WjE1eqMH0wZEa/82WqQeUqxdbCvJ22VEX0NQdxc=", + "lastModified": 1770696515, + "narHash": "sha256-v1xpFl35rw5/ldlYhU4lsBwfPbZb5g9Z08ClgmgPLC8=", "owner": "sellout", "repo": "flaky", - "rev": "738ee361b03ea92c15275e9a41d11f643f2544b1", + "rev": "e92458e2eef55299f97bb39f08ae483562730991", "type": "github" }, "original": { From 7cd48bb2452df2ebbbfe4a3244da3f0827a67dd6 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 2 Feb 2026 12:38:04 -0700 Subject: [PATCH 2/2] Updates to the Haskell template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - don’t build GHC 9.12 for i686-linux, as it fails - build (but don’t require) GHC HEAD - update HLS conditionalization - update required builds using excluded/included matrix entries - update hlint config - correct and document CHANGELOG tag links - correct Hackage badge link - add `this` source repository - add `GhcCompat` plugin (and update conditional flags correspondingly) --- templates/haskell/.config/flake/outputs.nix | 27 +++++++++------ templates/haskell/.config/project/default.nix | 33 ++++++++++++++++--- templates/haskell/.config/project/hlint.nix | 18 +++++++--- templates/haskell/core/CHANGELOG.md | 4 ++- templates/haskell/core/README.md | 2 +- templates/haskell/core/{{project.name}}.cabal | 30 ++++++++++------- 6 files changed, 80 insertions(+), 34 deletions(-) diff --git a/templates/haskell/.config/flake/outputs.nix b/templates/haskell/.config/flake/outputs.nix index 0123059..33a75fd 100644 --- a/templates/haskell/.config/flake/outputs.nix +++ b/templates/haskell/.config/flake/outputs.nix @@ -102,15 +102,17 @@ in ## one via GitHub workflow. Additionally, check any revisions that have ## explicit conditionalization. And check whatever version `pkgs.ghc` ## maps to in the nixpkgs we depend on. - testedGhcVersions = system: [ - self.lib.defaultGhcVersion - "9.4.8" - "9.6.7" - "9.8.4" - "9.10.2" - "9.12.2" - # "ghcHEAD" # doctest doesn’t work on current HEAD - ]; + testedGhcVersions = system: + [ + self.lib.defaultGhcVersion + "9.4.8" + "9.6.7" + "9.8.4" + "9.10.2" + ] + ++ nixpkgs.lib.optionals (system != "i686-linux") [ + "9.12.2" # GHC fails to build on i686-linux + ]; ## The versions that are older than those supported by Nix that we ## prefer to test against. @@ -170,7 +172,12 @@ in [self.projectConfigurations.${system}.packages.path] ## NB: Haskell Language Server no longer supports GHC <9.6. ++ nixpkgs.lib.optional - (nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9.6") + (nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9.6" + ## TODO: With Nixpkgs 25.11, HLS complains about conflicting package + ## versions in these combinations, so skip it. + && !(pkgs.stdenv.hostPlatform.isLinux + && nixpkgs.lib.versionAtLeast hpkgs.ghc.version "9.8" + && nixpkgs.lib.versionOlder hpkgs.ghc.version "9.10")) hpkgs.haskell-language-server); projectConfigurations = diff --git a/templates/haskell/.config/project/default.nix b/templates/haskell/.config/project/default.nix index 2132aac..b68c002 100644 --- a/templates/haskell/.config/project/default.nix +++ b/templates/haskell/.config/project/default.nix @@ -35,16 +35,39 @@ "check-licenses" ] ++ lib.concatMap (sys: - lib.concatMap (ghc: [ - "build (${ghc}, ${sys})" - "build (--prefer-oldest, ${ghc}, ${sys})" - ]) + lib.concatMap (ghc: + ## Don’t add `exclude`d matrix entries to the required list + ## + ## TODO: Make this less manual (like the `include` component). + if + ## GHC before 8.4 needs an older Ubuntu + lib.versionOlder ghc "8.4" + && sys == "ubuntu-24.04" + ## GHC doesn’t support ARM before GHC 9.2. + || lib.versionOlder ghc "9.2" + && builtins.elem sys ["macos-15" "ubuntu-24.04-arm"] + ## GHC 9.2.1 relied on libnuma at runtime for aarch64 + || ghc == "9.2.1" && sys == "ubuntu-24.04-arm" + then [] + else [ + "build (${ghc}, ${sys})" + "build (--prefer-oldest, ${ghc}, ${sys})" + ]) self.lib.nonNixTestedGhcVersions) - config.services.haskell-ci.systems); + config.services.haskell-ci.systems + ## Add `include`d matrix entries to the required list. + ++ map ( + entry: + if entry.bounds == "" + then "build (${entry.ghc}, ${entry.os})" + else "build (${entry.bounds}, ${entry.ghc}, ${entry.os})" + ) + config.services.haskell-ci.include); services.haskell-ci = { inherit (self.lib) defaultGhcVersion; ghcVersions = self.lib.nonNixTestedGhcVersions; cabalPackages = {"${config.project.name}" = "core";}; + ## The latest Stackage LTS that we also build on GitHub for. latestGhcVersion = "9.10.1"; }; diff --git a/templates/haskell/.config/project/hlint.nix b/templates/haskell/.config/project/hlint.nix index ec53432..ce9c82b 100644 --- a/templates/haskell/.config/project/hlint.nix +++ b/templates/haskell/.config/project/hlint.nix @@ -27,11 +27,19 @@ }; } - {ignore = {name = "Eta reduce";};} - {ignore = {name = "Evaluate";};} - {ignore = {name = "Reduce duplication";};} - {ignore = {name = "Use list comprehension";};} - {ignore = {name = "Use section";};} + { + ignore.name = [ + ## This can be removed once we no longer support ≤ base 4.18, which + ## doesn’t yet export `Data.Functor.unzip`. + "Avoid NonEmpty.unzip" + ## This complains when we use a common import and then import from the + ## same module under a CPP conditional. Since Ormolu handles combinig + ## imports when possible anyway, this warning isn’t helpful. + "Use fewer imports" + ## I just don’t like them (even the monadic variant). + "Use list comprehension" + ]; + } { package = { diff --git a/templates/haskell/core/CHANGELOG.md b/templates/haskell/core/CHANGELOG.md index 3e53a16..269c45d 100644 --- a/templates/haskell/core/CHANGELOG.md +++ b/templates/haskell/core/CHANGELOG.md @@ -11,4 +11,6 @@ and this project adheres to the [Haskell Package Versioning Policy](https://pvp. - initial release of this package -[0.0.1.0]: https://github.com/{{project.repo}}/releases/tag/v0.0.1.0 + + +[0.0.1.0]: https://github.com/{{project.repo}}/releases/tag/v0.1.0 diff --git a/templates/haskell/core/README.md b/templates/haskell/core/README.md index dfddc3a..de744f9 100644 --- a/templates/haskell/core/README.md +++ b/templates/haskell/core/README.md @@ -1,6 +1,6 @@ # {{project.name}} -[![Hackage Version](https://img.shields.io/hackage/v/{{project.name}})](https://hackage.haskell.org/package/{{project-name}}) +[![Hackage Version](https://img.shields.io/hackage/v/{{project.name}})](https://hackage.haskell.org/package/{{project.name}}) [![Packaging status](https://repology.org/badge/tiny-repos/haskell:{{project.name}}.svg)](https://repology.org/project/haskell:{{project.name}}/versions) [![latest packaged versions](https://repology.org/badge/latest-versions/haskell:{{project.name}}.svg)](https://repology.org/project/haskell:{{project.name}}/versions) diff --git a/templates/haskell/core/{{project.name}}.cabal b/templates/haskell/core/{{project.name}}.cabal index 3a703ed..86556e9 100644 --- a/templates/haskell/core/{{project.name}}.cabal +++ b/templates/haskell/core/{{project.name}}.cabal @@ -44,11 +44,19 @@ tested-with: homepage: https://github.com/{{project.repo}}#readme bug-reports: https://github.com/{{project.repo}}/issues + source-repository head type: git location: https://github.com/{{project.repo}}.git subdir: core +source-repository this + type: git + location: https://github.com/{{project.repo}}.git + subdir: core + -- NB: This is the repo version, which is distinct from the package version. + tag: v0.1.0 + custom-setup setup-depends: -- TODO: Due to haskell/cabal#3751, `Cabal` has to be specified even though @@ -139,7 +147,11 @@ common defaults import: GHC2024 build-depends: base ^>= {4.8.2, 4.9.0, 4.10.0, 4.11.0, 4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0, 4.20.0, 4.21.0}, + ghc-compat-plugin ^>= {0.1.0}, ghc-options: + -fplugin GhcCompat + -fplugin-opt GhcCompat:minVersion=7.10.3 + -fplugin-opt GhcCompat:reportIncompatibleExtensions=error if impl(ghc >= 8.0.1) ghc-options: -Weverything @@ -157,20 +169,14 @@ common defaults else ghc-options: -Wall - -- remove if the oldest supported version is GHC 8.10.1+ - if impl(ghc >= 8.10.1) - ghc-options: - -Wno-prepositive-qualified-module - -- remove if the oldest supported version is GHC 9.2.1+ - if impl(ghc >= 9.2.1) + if impl(ghc >= 8.6.1) ghc-options: - -Wno-missing-kind-signatures - if impl(ghc >= 9.8.1) + -- remove if oldest supported version is GHC 8.6.1 + -Wno-star-is-type + if impl(ghc >= 8.8.1) ghc-options: - -- remove if the oldest supported version is GHC 9.2.1+ - -Wno-missing-poly-kind-signatures - -- Inference good. - -Wno-missing-role-annotations + -- remove if oldest supported version is GHC 8.2.1 + -Wno-missing-deriving-strategies default-extensions: -- BlockArguments - uncomment if the oldest supported version is GHC 8.6.1+ DefaultSignatures