# Teaser: pluggable cabal backends and a Nix backend

> Source: <https://discourse.haskell.org/t/teaser-pluggable-cabal-backends-and-a-nix-backend/15261#post_1>
> Published: 2026-12-04 00:10:10+00:00

**Key takeaway:** Cabal can now run as a frontend over pluggable backends, and the cabal-sandstone Nix backend resolves GHC and foreign library dependencies automatically while caching intermediate build artifacts in the Nix store, at the cost of absolute speed versus cabal-buck2.

As is the trend,[@Ericson2314](https://discourse.haskell.org/u/ericson2314) and I have been doing some LLM-assisted prototyping of Haskell devX improvements. We changed Cabal (`cabal-install`) into a frontend for build systems, making the original behavior just one of many backend options. If all goes well, Cabal’s commands will just keep working as normal with any backend.

[@simonmar](https://discourse.haskell.org/u/simonmar)’s [Buck2 build system](https://discourse.haskell.org/t/buck2-build-system-for-cabal-projects/14770) could become one of these (instead of an [external command](https://cabal.readthedocs.io/en/stable/external-commands.html)), and we’ve been implementing a Nix-backend as well. Incremental Nix builds for GHC had already been implemented in [sandstone](https://github.com/obsidiansystems/sandstone), so it was relatively easy to create this backend.

Here’s a little demo showing the behavior of the “classic” backend vs. the Nix (cabal-sandstone) backend:

The code for the backend is available for anyone caring to look: [GitHub - parenthetical/cabal-sandstone: A Nix backend for Cabal · GitHub](https://github.com/parenthetical/cabal-sandstone) . The repository contains Git submodules linking to our Cabal fork (and many other forks ).

Although the `cabal-sandstone` backend shares many advantages with the [cabal-buck2](https://github.com/simonmar/cabal-buck2) command, it still loses out absolute performance.

However, in return you are freed from worrying about how to get GHC, foreign library dependencies, etc. Getting all your build tools and libraries just happens magically, as long as they are correctly declared in your project and your project’s dependencies’ cabal files.

You also get a centralized persistent cache for (intermediate) build artifacts through the Nix store (I always end up with gigabytes of dist-newstyle spread over my worktrees.)

For users who have tried building Haskell with Nix before, here are some differences from prior attempts to be aware of:

`cabal-sandstone` in fact doesn’t use the Nix language at all, and certainly no “import from derivation”. All build plan are expressed with low-level “nix store layer” primitives, most notably We know our myriad Cabal changes are not going to go upstream in one giant PR. We have a plan to upstream the work “bottom-up”, first addressing some foundational longstanding architectural issues in Cabal, and then decoupling Cabal’s “backend” using that foundation. See some of [@ericson2314](https://discourse.haskell.org/u/ericson2314)’s open/draft Cabal PRs for a sneak preview of what that first step entails.

Happy to answer any questions
