| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 05:14:29 GMT
X-Served-By: cache-dfw-ktki8620047-DFW, cache-bom-vanm7210066-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768626868.255521,VS0,VE779
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
stack2nix: Convert stack.yaml files into Nix build instructions.
stack2nix: Convert stack.yaml files into Nix build instructions.
Downloads
- stack2nix-0.2.3.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.2, 0.2.1, 0.2.2, 0.2.3 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | async (>=2.1.1.1 && <2.3), base (>=4.9 && <4.13), bytestring, Cabal (>=2.0.0.2 && <2.5), cabal2nix (>=2.10), containers (>=0.5.7.1 && <0.7), directory (>=1.3 && <1.4), distribution-nixpkgs (>=1.1 && <1.3), filepath (>=1.4.1.1 && <1.5), hackage-db, language-nix, lens, optparse-applicative (>=0.13.2 && <0.15), path, pretty, process (>=1.4.3 && <1.7), regex-pcre (>=0.94.4 && <0.95), SafeSemaphore (>=0.10.1 && <0.11), stack (>=1.9), stack2nix, temporary (>=1.2.0.4 && <1.4), text (>=1.2.2.1 && <1.3), time [details] |
| License | MIT |
| Author | IOHK DevOps |
| Maintainer | stack2nix@iohk.io |
| Uploaded | by domenkozar at 2019-04-29T03:03:05Z |
| Category | Distribution, Nix |
| Source repo | head: git clone https://github.com/input-output-hk/stack2nix.git |
| Distributions | |
| Executables | stack2nix |
| Downloads | 4369 total (25 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2019-04-29 [all 1 reports] |
Readme for stack2nix-0.2.3
[back to package description]stack2nix
About
stack2nix automates conversion from Stack configuration file to Nix expressions. The purpose is to map stack.yaml one-to-one into Nix expressions.
stack2nix high-level workflow:
- Generate stackage snapshot to determine complete fixed version list of packages based on resolver
- apply any additional configuration (local packages, extra dependencies, etc) from
stack.yaml - generate complete list of dependencies to Nix expressions, replacing upstream
hackage-packages.nix
Installation
There are two options. The first - using Nix is recommended. If there are difficulties please file an issue.
Nix (recommended)
- Install Nix.
- Clone this repo.
- Run
nix-buildto build.
Stack + Nix
- Install Nix.
- Clone this repo.
- Run
stack install --nixto install.
Usage
Nix expressions generated by stack2nix require NixOS 17.09 or later.
Local Packages
Sometimes it's convenient to build local Haskell packages. Assuming the current directory is a locally maintained fork of Pandoc:
$ stack2nix . > default.nix
$ nix-build -A pandoc
Remote Packages
Stack2nix can generate a nix expressions for Haskell packages hosted in git repositories.
$ stack2nix --revision 242e2a064f6a32b22e1599bbfe72e64d7b6203b8 https://github.com/jgm/pandoc.git > demo.nix
$ nix-build -A pandoc demo.nix
Testing
Run ./scripts/travis.sh to build and test.