on de4cdad help sign in

A fork of haskell.nix with a more efficient GHCJS 8.10 compiler

git clone https://git.iko.soy/haskell.nix.git
#+STARTUP: showall hidestars

** :warning: The Overlay branch #261 was merged. haskell.nix is now works as an overlay and the dependency on iohk-nix was dropped. Please see the updated documentation! Once any remaining issues are resolved, this will mark the 1.0 release of haskell.nix. :warning:

* Alternative Haskell Infrastructure for Nixpkgs

[[https://buildkite.com/input-output-hk/haskell-dot-nix][https://badge.buildkite.com/d453edcd29bd2f8f3f3b32c9b7d6777a33773d9671c37a6ccc.svg?branch=master]]
[[https://buildkite.com/input-output-hk/haskell-dot-nix-nightly-updates][https://img.shields.io/buildkite/c8d5a20d3ff0f440f82adb9190b43c16c91e5e47e8adfa867a/master.svg?label=nightly%20updates]]

=haskell.nix= is an experimental new builder for Haskell packages.

It works by automatically translating your Cabal or Stack project and
its dependencies into Nix code.  It provides IFD (imports from derviation)
functions that can minimize the amount of nix code you need to add.

For the documentation, see https://input-output-hk.github.io/haskell.nix/.

** Quickstart

For =cabal.project= project add a =default.nix=:

#+begin_src sh
{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
, haskellCompiler ? "ghc865"
}:
  pkgs.haskell-nix.cabalProject {
    src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
    ghc = pkgs.buildPackages.pkgs.haskell.compiler.${haskellCompiler};
  }
#+end_src

For a =stack.yaml= project add a =default.nix=:

#+begin_src sh
{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
}:
  pkgs.haskell-nix.stackProject {
    src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
  }
#+end_src

To build the library component of a package in the project run:

#+begin_src sh
nix build -f . your-package-name.components.library
#+end_src

To build an executable:

#+begin_src sh
nix build -f . your-package-name.components.exes.your-exe-name
#+end_src

To open a shell for use with `cabal` run:

#+begin_src sh
nix-shell -A shellFor
cabal new-build your-package-name
cabal new-repl your-package-name:library:your-package-name
#+end_src

** Related repos

The =haskell.nix= repository contains the runtime system for building
Haskell packages in Nix. It depends on other repos, which are:

- [[https://github.com/input-output-hk/nix-tools][nix-tools]] โ€” provides the programs for generating Nix expressions from
  Haskell projects.

- [[https://github.com/input-output-hk/hackage.nix][hackage.nix]] โ€” the latest contents of the [[https://hackage.haskell.org/][Hackage]] databases,
  converted to Nix expressions.

- [[https://github.com/input-output-hk/stackage.nix][stackage.nix]] โ€” all of the [[https://www.stackage.org/][Stackage]] snapshots, converted to Nix
  expressions.

** IRC Channel

Join the [[https://www.irccloud.com/invite?channel=%23haskell.nix&hostname=irc.freenode.net&port=6697&ssl=1][#haskell.nix]] channel on [[https://freenode.net/][irc.freenode.net]] to get help or discuss
the development of =haskell.nix= and =nix-tools=.