A fork of haskell.nix with a more efficient GHCJS 8.10 compiler
Go to file
Rodney Lorrimar 2e4b4ebbb3
cleanSourceHaskell: Add more filters (#314)
* cleanSourceHaskell: Add more filters

* cleanSourceHaskell: Add a "name" parameter, split away the filter

* cleanSourceHaskell: Make it compatible with nixpkgs-19.03

* Adjust usage of cleanSourceHaskell in nix-tools
2019-11-18 16:46:39 +10:00
.buildkite Reduce closure size of nix-tools (#178) 2019-06-15 07:18:06 +02:00
builder Add passthru.run with wine support (#301) 2019-11-11 23:38:08 +13:00
compiler Check ghc used is haskell-nix.compiler one (#312) 2019-11-11 01:01:30 +13:00
docs cleanSourceHaskell: Add more filters (#314) 2019-11-18 16:46:39 +10:00
examples Use latest cardano-wallet for testing (#296) 2019-11-06 23:42:12 +13:00
lib cleanSourceHaskell: Add more filters (#314) 2019-11-18 16:46:39 +10:00
mk-local-hackage-repo Overlays (#261) 2019-10-21 20:07:58 +08:00
modules Exclude pre/postCheck from all used by shellFor (#306) 2019-11-08 21:01:47 +13:00
nix-tools cleanSourceHaskell: Add more filters (#314) 2019-11-18 16:46:39 +10:00
nixpkgs Test setup deps issue depending on ghc and Cabal (#278) 2019-11-01 12:34:10 +13:00
overlays cleanSourceHaskell: Add more filters (#314) 2019-11-18 16:46:39 +10:00
patches Overlays (#261) 2019-10-21 20:07:58 +08:00
pkgs Overlays (#261) 2019-10-21 20:07:58 +08:00
scripts Test setup deps issue depending on ghc and Cabal (#278) 2019-11-01 12:34:10 +13:00
test Revert "Disable all the tests except the haskellNixRoots" 2019-11-15 14:20:16 +13:00
.gitattributes Overlays (#261) 2019-10-21 20:07:58 +08:00
.gitignore More documentation (#179) 2019-06-15 07:11:52 +02:00
build.nix Test setup deps issue depending on ghc and Cabal (#278) 2019-11-01 12:34:10 +13:00
changelog.md cleanSourceHaskell: Add more filters (#314) 2019-11-18 16:46:39 +10:00
ci.nix build more plutus pkgs (#268) 2019-11-06 23:41:27 +13:00
config.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
COPYING License Apache 2.0 2019-04-29 11:08:31 +08:00
default.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
hackage-src.json Update Hackage and Stackage 2019-11-18 01:07:39 +00:00
mkdocs.yml docs: Add note about shellFor and CABAL_CONFIG (#247) 2019-09-24 08:53:20 +10:00
package-set.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
README.org Add information about the binary cache to README.org (#300) 2019-11-14 10:35:21 +08:00
release.nix Test setup deps issue depending on ghc and Cabal (#278) 2019-11-01 12:34:10 +13:00
shell.nix Cross comp. & callCabalProjectToNix/callStackToNix (#202) 2019-07-13 22:13:15 +08:00
snapshots.nix fix #269. Apply fix to mkStackPkgSet (#310) 2019-11-09 17:01:04 +13:00
stackage-src.json Update Hackage and Stackage 2019-11-18 01:07:39 +00:00
test-ghcjs.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
test-mingw32.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
test-rpi.nix Overlays (#261) 2019-10-21 20:07:58 +08:00
test.nix Overlays (#261) 2019-10-21 20:07:58 +08:00

⚠️ The Overlay branch #261 was merged. haskell.nix is now 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://badge.buildkite.com/d453edcd29bd2f8f3f3b32c9b7d6777a33773d9671c37a6ccc.svg?branch=master 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:

{ 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-nix.compiler.${haskellCompiler};
  }

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

{ 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 = ./.; };
  }

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

nix build -f . your-package-name.components.library

To build an executable:

nix build -f . your-package-name.components.exes.your-exe-name

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

nix-shell -A shellFor
cabal new-build your-package-name
cabal new-repl your-package-name:library:your-package-name

Cache

CI pushes to cachix so you can benefit from the cache if you pin a combination of haskell.nix and nixpkgs built by CI.

You'll need to configure the https://nix-tools.cachix.org as a substituter for nix and add the public key found at the url to trusted-public-keys.

Related repos

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

  • nix-tools — provides the programs for generating Nix expressions from Haskell projects.
  • hackage.nix — the latest contents of the Hackage databases, converted to Nix expressions.
  • stackage.nix — all of the Stackage snapshots, converted to Nix expressions.

IRC Channel

Join the #haskell.nix channel on irc.freenode.net to get help or discuss the development of haskell.nix and nix-tools.