Giter VIP home page Giter VIP logo

haskell.nix's Introduction

⚠️ 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.

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 nix-tools 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.

haskell.nix's People

Contributors

rvl avatar angerman avatar hamishmack avatar elvishjerricco avatar jbgi avatar eamsden avatar considerate avatar luke-clifton avatar yorickvp avatar toonn avatar ttuegel avatar ruhatch avatar purefn avatar michaelpj avatar qrilka avatar cdepillabout avatar balsoft avatar aycanirican avatar chreekat avatar dcao avatar domenkozar avatar kirelagin avatar deepfire avatar matthewess avatar philderbeast avatar srid avatar smatting avatar zx9w avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.