Skip to content

Filter source with lib.fileset#33

Merged
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:fileset-source-filter
Jun 6, 2026
Merged

Filter source with lib.fileset#33
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:fileset-source-filter

Conversation

@jappeace-sloth

Copy link
Copy Markdown

Summary

  • Replace callCabal2nix "template-project" ../. {} with an explicit lib.fileset.toSource that unions app/, src/, test/, template.cabal, LICENSE, Readme.md, and Changelog.md.
  • Addresses the existing TODO note in nix/hpkgs.nix about nix and tooling files being considered part of the build input.
  • Editing shell.nix, nix/, .github/, makefile, .hlint.yaml, .stylish-haskell.yaml, brittany.yaml, etc. no longer invalidates the cabal2nix-driven haskell build cache.

Test plan

  • nix-build builds template-1.0.0 and the unit suite (5 tests) passes locally.
  • CI green on GitHub Actions.

🤖 Generated with Claude Code

Replaces `callCabal2nix "template-project" ../. {}` with an explicit
`lib.fileset.toSource` that unions only app/, src/, test/, the cabal
file, LICENSE, Readme.md and Changelog.md. This addresses the existing
note that nix/tooling files were considered for the build, and so the
cabal2nix-driven derivation no longer rebuilds when shell.nix,
nix/hpkgs.nix, .github/, makefile, .hlint.yaml etc. change.

Verified locally with `nix-build` — template-1.0.0 builds and the
unit test suite (5 tests) passes.

Prompt: go update my haskell-template-project, I want find grained
source filtereing like this: [lib.fileset.toSource snippet]

Tokens: ~25k
@jappeace jappeace merged commit fdba206 into jappeace:master Jun 6, 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