Using Nix to Deploy Haskell Projects
summary
Hands-on workshop that teaches using Nix to make Haskell builds reproducible: explains the Nix store, derivations and hashing, how nixpkgs generates ~17,000 Hackage derivations (about 7,000 actually build), and tradeoffs around GHC versions. Covers a flake-based setup, using nix-shell environments for reproducible dev shells, setting up CI with binary caches, generating builds with cabal2nix via flakes, overriding sources/patches and adding git hooks, plus steps to upstream fixes into nixpkgs and when import‑from‑derivation causes problems.
AI-written summary · about
chapters (37)
- 0:00Introduction and session overview
- 1:15Goals and workshop structure
- 2:32What is Nix and why use it for Haskell
- 4:30Problem 1 – Exponent parsing and summing
- 7:07Speaker background and company info
- 8:16Four meanings of "Nix" explained
- 11:25Nix store and functional principles
- 14:17Nix language and nix files
- 16:09Derivations vs evaluation
- 20:16Nixpkgs – the giant collaborative repository
- 23:19NixOS and system configuration
- 25:01Documentation and community support
- 27:15Why use Nix for Haskell development
- 31:05Nix vs Docker in terms of reproducibility
- 35:14Binary caches and provisioning dev environments
- 38:03Overview of Haskell infrastructure in nixpkgs
- 41:14Haskell.nix vs Haskell infrastructure in nixpkgs
- 42:14Using cabal2nix to generate derivations
- 47:05Dependency resolution and package sets
- 52:12Using cabal2nix via flakes
- 54:42Aligning nix builds with cabal freeze
- 57:14Overriding packages and custom sources
- 1:00:00The tutorial tasks – how to nixify a project
- 1:05:07Git hooks and pre-commit automation
- 1:08:02Setting up CI pipelines with Nix
- 1:09:23Hackage snapshot usage in nixpkgs
- 1:13:24Package versioning and overrides
- 1:16:27How nixpkgs tracks revisions
- 1:17:40Naming and versioning in nixpkgs
- 1:22:20Maintaining broken packages
- 1:24:01Internals of nix store and hashing
- 1:25:57Overriding dependencies and patching
- 1:34:50Personal experiences contributing to nixpkgs
- 1:40:27Discussion: flakes, complexity and usage
- 1:46:09Why learning Nix is hard
- 1:52:25The future of flakes
- 2:00:19Outro and contact
related talks
01h 11mHaskell in Production: Adventures in Blockchain Building
01h 32mThe GHC Packaging Ecosystem
01h 22mGetting Up and Running, and Contributing to GHC
54mHaskell Project Showcase and Community Contributions
01h 02mOptimising for fast builds with GHC
53mFalling Skies: Haskell Tooling and Ecosystem Growth
03h 04mHaskell for Beginners: Learn Functional Programming from Scratch
49mHaskell On Rails
