BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

Add nix packaging support using haskell.nix #483

Closed chaserhkj closed 3 months ago

chaserhkj commented 3 months ago

This PR adds nix packaging for BNFC using haskell.nix, allowing it to be integrated directly with the nix ecosystem, producing more reproducible builds as well.

Note that this does not invalidate the current stack-based build system, this is just additional nix build scripts that can be used by nix systems, quite like the Dockerfile we are already providing. This does not create multiple sources of truth for building as well since haskell.nix reads stack yaml configurations and generate build instructions on the fly.

andreasabel commented 3 months ago

Thanks for the contribution!

Would be great if this could be tested by a GitHub workflow (CI), so that it does not bit-rot. Do you think you can add such a workflow? I have seen it e.g. at https://github.com/haskell/hackage-server/blob/8a8d7391b819921f67aa446c134a2bf83da1b9b4/.github/workflows/nix-flake.yml

chaserhkj commented 3 months ago

Workflow is added, should be working now for both os x and linux builds using nix. A few notes:

andreasabel commented 3 months ago

Excellent, I'll merge this now!

I cannot promise to maintain this, unfortunately, as I lack the nix skills. So further involvement would be appreciated.