Skip to content

Add nix/ci.nix and enforce hlint in CI#34

Merged
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:add-ci-nix-with-hlint
Jun 11, 2026
Merged

Add nix/ci.nix and enforce hlint in CI#34
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:add-ci-nix-with-hlint

Conversation

@jappeace-sloth

Copy link
Copy Markdown

Summary

  • New nix/ci.nix with two attrs: native (imports default.nix, the existing cabal build) and hlint (runs hlint -h .hlint.yaml app src test via pkgs.runCommand, pinning the hlint version to the project's nixpkgs).
  • GHA nix job now runs nix-build nix/ci.nix instead of nix-build, so the hlint pass is enforced alongside the build. The matrix cabal job is unchanged (no nix available).
  • Mirrors the pattern already used in jappeace/mijn-webwinkel-migraine's nix/ci.nix.

Test plan

  • nix-build nix/ci.nix builds locally — both native and ci-hlint derivations come back green; hlint reports "No hints" against the current app/src/test tree
  • .hlint.yaml already existed in the template; CI was just not invoking hlint
  • GHA nix job runs nix-build nix/ci.nix on this PR

🤖 Generated with Claude Code

CI was calling 'nix-build' (== default.nix), which only produces the
cabal build derivation; .hlint.yaml was a sample file with no
enforcement, so projects derived from this template silently drifted
away from their lint configuration.

Introduces 'nix/ci.nix' with two attrs:

  - native: imports default.nix, so 'nix-build nix/ci.nix' still
            produces the cabal build derivation
  - hlint:  runs 'hlint -h .hlint.yaml app src test' inside a
            'pkgs.runCommand' derivation, pinning the hlint binary
            to the same nixpkgs as the rest of the toolchain

The GitHub Actions 'nix' job is updated to 'nix-build nix/ci.nix' so
the hlint pass runs alongside the build instead of needing a separate
workflow step. The cabal-only matrix job is unchanged — it doesn't
have nix available.

Mirrors the same pattern used in jappeace/mijn-webwinkel-migraine's
nix/ci.nix.

Prompt: add the same idea to haskell-template-project. we want hlint
enabled in ci.nix

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jappeace jappeace merged commit d649164 into jappeace:master Jun 11, 2026
13 checks passed
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.

2 participants