stackage2nix: Convert Stack files into Nix build instructions.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]


[Skip to Readme]


Versions 0.3.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2
Change log
Dependencies aeson, base (>4.7 && <5), bytestring, Cabal (>1.24), cabal2nix (>=2.5), containers, deepseq, distribution-nixpkgs (>=1.1), exceptions (>0.8), filepath, gitlib (>3), gitlib-libgit2 (>3), hopenssl (>2.2), inflections, language-nix, lens, network-uri, optparse-applicative, pretty, QuickCheck, stackage-curator (>=0.15), stackage2nix, text, unordered-containers, yaml [details]
License BSD-3-Clause
Author Dmitry Bushev , Benno Fünfstück
Category Distribution, Nix
Home page
Source repo head: git clone
Uploaded by typeable at 2017-08-29T10:21:27Z




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Readme for stackage2nix-0.3.0

[back to package description]


Build Status

stackage2nix converts a Stack file into a Nix Haskell packages set. It creates LTS Stackage packages set, and applies appropriate overrides on top of it.

stackage2nix \
  --lts-haskell "$LTS_HASKELL_REPO" \
  --all-cabal-hashes "$ALL_CABAL_HASHES_REPO" \

stackage2nix has three required arguments:

Produced Nix derivation split on following files:

A particular package from result Haskell packages set can be built with:

nix-build -A <package-name>

Runtime dependencies

Override result derivation

Complex projects may require some extra customization. Snippet override.nix below shows a minimal example of how to apply additional overrides on top of Haskell packages set produced by stackage2nix.

with import <nixpkgs> {};
with pkgs.haskell.lib;
let haskellPackages = import ./. {};
in haskellPackages.override {
  overrides = self: super: {
    stackage2nix = disableSharedExecutables super.stackage2nix;
nix-build -A stackage2nix override.nix

For more complex overrides and detailed information on how to work with Haskell packages in Nix, see Nixpkgs manual User’s Guide to the Haskell Infrastructure


For other examples of stackage2nix usage, see 4e6/stackage2nix-examples repository. It verifies stackage2nix by running it on different public projects.