# Caching for incremental changes (including \`ghc-nix\`)

**URL:** <https://discourse.haskell.org/t/caching-for-incremental-changes-including-ghc-nix/13606>\
**Category:** Learn\
**Created:** [January 27, 2026, 7:55am UTC](https://discourse.haskell.org/t/caching-for-incremental-changes-including-ghc-nix/13606 "2026-01-27T07:55:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![alexfmpe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/alexfmpe/32/5150_2.png) [@alexfmpe](https://discourse.haskell.org/u/alexfmpe)\
**Post date:** [January 30, 2026, 3:31am UTC](https://discourse.haskell.org/t/caching-for-incremental-changes-including-ghc-nix/13606/6 "2026-01-30T03:31:33Z")

</div>

> So going back to GHCI, one of my main issues is of course I’d like my editor to use HLS, and at least with what I’ve found with the VSCode plugin, it just calls `cabal` on the command line

IIUC it calls `cabal repl` which will use GHCi under the hood.

> another way I should go about getting HLS to work quickly and responsively particularly on a significant codebase

Generally making typechecking faster should help, probably also want to enable multi-repl. See [Cheaper: producing a program with less developer time](https://discourse.haskell.org/t/cheaper-producing-a-program-with-less-developer-time/13225)

> really want my local dev and “prod” builds using the same package set.

You can easily get a nix-shell which will build all your dependencies with nix (exactly same derivations as your prod build) so that only your actual project, where you’ll be iterating, is built with cabal/ghci, for fast iteration.

You just need your `shell.nix` to consist of a call to `shellFor`. Throw your own local packages into `packages`, then cabal/ghcid/etc into `nativeBuildInputs`. You can also throw HLS in there, but you’ll want to run `code .` inside the shell and tell VSCode to use $PATH instead of installing HLS itself.

Example usage:

> <https://github.com/alexfmpe/obenstein/blob/90ee3345a95eb157278d8d52c5929c06ed9a8057/project.nix#L64>

shellFor definition:

> <https://github.com/NixOS/nixpkgs/blob/6308c3b21396534d8aaeac46179c14c439a89b8a/pkgs/development/haskell-modules/make-package-set.nix#L461>

---

_[View the full topic](https://discourse.haskell.org/t/caching-for-incremental-changes-including-ghc-nix/13606)._
