# My simple multi-package Haskell project template flake

**URL:** https://discourse.nixos.org/t/my-simple-multi-package-haskell-project-template-flake/79891
**Category:** Guides
**Created:** [September 2, 2026, 12:05pm UTC](https://discourse.nixos.org/t/my-simple-multi-package-haskell-project-template-flake/79891 "2026-09-02T12:05:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oo-infty](https://discourse.nixos.org/user_avatar/discourse.nixos.org/oo-infty/32/38313_2.png) [@oo-infty](https://discourse.nixos.org/u/oo-infty)
#### Post date: [September 2, 2026, 12:05pm UTC](https://discourse.nixos.org/t/my-simple-multi-package-haskell-project-template-flake/79891/1 "2026-09-02T12:05:24Z")

</div>

I’m a new beginner to Haskell and I want to do Haskell development on NixOS. After some learning and researching, I finally settled on the existing Haskell infrastructure in Nixpkgs. So I managed to make this flake template that helps develop, package, and deliver a Haskell software.

I hope this can help you get started on a new Haskell project more conveniently and provide a reference for others who are new to Nix or Haskell. Although many techniques used in this template are trivial to you, I’d like to share my efforts and achievements just for fun. 😃

> **[StarryNix-Bootstrap/templates/haskell at main ·...](https://github.com/StarryReverie/StarryNix-Bootstrap/tree/main/templates/haskell)**
>
> Nix flake templates for bootstrapping projects instantly - StarryReverie/StarryNix-Bootstrap

This template includes the following basic functionalities, thanks to the brilliant Nix and Nixpkgs:

- GHC and prebuilt artifacts of dependencies
- Development shell with Haskell language server, hlint, hoogle, ghcid, etc.
- Cabal-install as development build tool and Nix as production build tool

I also try to add more functionalities to make development experience better:

- Discover Haskell packages automatically, as long as they are put in the `hs-packages` directory.
- Support both IFD via `callCabal2nix` and pre-generated `package.nix` using `cabal2nix`. The latter is preferred if exists.
- Convenient `just` recipes for running `hpack` and `cabal2nix`.
- Separate dev flake partition, based on `flake-parts.flakeModules.partitions`, in case that new development flake inputs are added, which won’t pollute this flake’s end users’ flake.lock.

Any suggestions are welcomed. I will be very appreciated of your feedback!
