name: stackage2nix
description: 

For package maintainers and hackage trustees





stackage2nix converts a Stack file into a Nix Haskell packages set.

Command creates file default.nix which overrides haskell.packages.stackage
packages set. You should use
typeable/nixpkgs-stackage overlay that
adds LTS Stackage packages to Nixpkgs.

Build package with overlay installed:

If you don&#39;t want to use Stackage overlay, stackage2nix can generate required
packages with --with-stackage-closure flag.

To generate Stackage packages, you should supply additional
--all-cabal-hashes and --lts-haskell flags that points to
commercialhaskell/all-cabal-hashes
checked out to hackage branch and
fpco/lts-haskell respectively.

You can use stackage2nix wrapper from nix directory that adds required flags:

This command will produce packages.nix and configuration-packages.nix
Stackage packages and its override in default.nix

--with-stackage parameter generates full Stackage LTS in addition to the
targets from stack.yaml

You can also generate only Stackage packages set from the resolver:

This command will produce Stackage packages packages.nix, packages config
configuration-packages.nix and a Haskell packages set default.nix.

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.

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

Integration tests that build stackage2nix form different yaml configs:
license_spdx: BSD-3-Clause
version: 0.7.0
spec_version: 1.0
download_url: http://hackage.haskell.org/package/stackage2nix-0.7.0/stackage2nix-0.7.0.tar.gz
home_url: 
            
              https://github.com/typeable/stackage2nix#readme
            
          
news_url: https://libraries.io/hackage/stackage2nix/versions.atom
date: 2018-04-23
about_resource: NONE
libraries_io_url: https://libraries.io/hackage/stackage2nix?number=0.7.0
vcs_tool: git
vcs_repository: https://github.com/typeable/stackage2nix
vcs_branch: master
