This note covers `05-haskell/`, which packages a tiny Cabal library and executable with Nix, runs a Cabal test suite during `nix flake check`, and provides a dev shell for editing it.
That keeps the example focused on one idea: a flake can describe a small Haskell project end to end, including code, tests, and a development environment.
The first argument is the package name as it should appear in Nix. The second is the source tree. The third is an attrset of overrides, which this example leaves empty.
That derivation becomes `packages.<system>.default`, so `nix build` produces the executable, and `nix run` executes it.
---
## 3. The Dev Shell
The dev shell uses `pkgs.mkShell` and adds the tools you need to edit and run the project:
-`ghc` for the compiler,
-`cabal-install` for local development commands, and
-`haskell-language-server` for editor support.
This keeps the shell small and obvious. For projects with many Haskell dependencies, `shellFor` can construct a shell from the package set itself, but this example stays with `mkShell` to keep the mechanics visible.