A fork of haskell.nix with a more efficient GHCJS 8.10 compiler
Go to file
Michael Peyton Jones 33dc7bce34
Tidy ci.nix using dimension (#500)
I recently came across this rather nice way of structuring build
matrices for ci.nix.

I think it makes the haskell.nix ci.nix a lot clearer!
2020-03-20 20:52:34 +13:00
.buildkite Replace collectRunComponents with haskellLib.check (#316) 2019-11-29 23:28:47 +13:00
builder ghcjs: copy and run tests (#494) 2020-03-17 22:20:08 +13:00
compiler Update old-ghc-nix (#486) 2020-03-12 10:07:13 +08:00
docs Add collectChecks functions (#498) 2020-03-20 19:34:40 +13:00
examples Use latest cardano-wallet for testing (#296) 2019-11-06 23:42:12 +13:00
lib Add AGPL-3.0-only and AGPL-3.0-or-later to cabal-licenses.nix (#503) 2020-03-20 20:15:03 +13:00
materialized build ghcjs (#382) 2020-02-09 20:03:22 +08:00
mk-local-hackage-repo Overlays (#261) 2019-10-21 20:07:58 +08:00
modules fix profilingDetail errors when enabling profiling (#493) 2020-03-17 18:45:56 +13:00
nix-tools bump nix-tools 2020-03-07 21:08:50 +08:00
nixpkgs Update nixpkgs pins (#477) 2020-03-10 14:53:40 +13:00
overlays Fix reinstallable ghc for ghc 8.8.3 (#502) 2020-03-20 11:12:03 +13:00
patches Fix singletons patch (#409) 2020-01-21 17:10:48 +08:00
pkgs Overlays (#261) 2019-10-21 20:07:58 +08:00
scripts bump scripts 2020-03-06 21:52:05 +08:00
test Fix evaluation of haskellLib.collectComponents (#479) 2020-03-09 20:47:26 +10:00
.gitattributes Overlays (#261) 2019-10-21 20:07:58 +08:00
.gitignore bump nix tools (#476) 2020-03-06 17:19:45 +08:00
bors.toml Add bors.toml to enable bors 2020-03-05 12:22:57 +13:00
build.nix Use 19.09 nixpkgs pin for update-docs script (#339) 2019-12-04 10:56:28 +08:00
changelog.md Change LLVM versions for ghc-8.6 to LLVM 6 (#385) 2020-01-07 19:12:32 +13:00
ci.nix Tidy ci.nix using dimension (#500) 2020-03-20 20:52:34 +13:00
config.nix 19.09 compat (#403) 2020-01-16 16:25:31 +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
dimension.nix Tidy ci.nix using dimension (#500) 2020-03-20 20:52:34 +13:00
hackage-src.json Update Hackage and Stackage 2020-03-20 01:15:46 +00:00
mkdocs.yml docs: Add note about shellFor and CABAL_CONFIG (#247) 2019-09-24 08:53:20 +10:00
package-set.nix Fix evaluation of haskellLib.collectComponents (#479) 2020-03-09 20:47:26 +10:00
README.org Link to iohk.cachix.org instead of nix-tools.cachix.org (#452) 2020-02-22 07:39:37 +08:00
release.nix Fix musl test configuring openssl as linux-x86_64 (#490) 2020-03-17 17:28:09 +13:00
shell.nix Fix shell.nix (#499) 2020-03-19 12:26:57 +13: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 2020-03-19 01:16:21 +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

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};
  }

Note that you'll need to add a comment specifying the expected sha256 output for your source-repository-packages in your cabal.project file:

source-repository-package
  type: git
  location: https://github.com/input-output-hk/iohk-monitoring-framework
  subdir:   plugins/backend-editor
  tag: 4956b32f039579a0e7e4fd10793f65b4c77d9044
  --sha256: 03lyb2m4i6p7rpjqarnhsx21nx48fwk6rzsrx15k6274a4bv0pix

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 iohk cachix 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.