1
1
mirror of https://github.com/nmattia/snack.git synced 2024-09-11 03:45:32 +03:00
Nix-based incremental build tool for Haskell projects
Go to file
2018-07-01 13:50:16 +02:00
bin Reimplement snack-exe in haskell 2018-07-01 13:50:16 +02:00
nix Reimplement snack-exe in haskell 2018-07-01 13:50:16 +02:00
script Reimplement snack-exe in haskell 2018-07-01 13:50:16 +02:00
snack-lib Reimplement snack-exe in haskell 2018-07-01 13:50:16 +02:00
tests Reimplement snack-exe in haskell 2018-07-01 13:50:16 +02:00
.gitignore Rename project description 2018-05-19 20:08:50 +02:00
.travis.yml Add travis 2018-05-31 23:26:42 +02:00
default.nix nix: introduce an overlay 2018-06-08 13:44:49 +01:00
README.md Improve README 2018-05-31 23:48:23 +02:00
shell.nix nix: introduce an overlay 2018-06-08 13:44:49 +01:00

Build Status built with nix

Snack

snack is a Haskell build tool.

Usage

You need a snack.nix:

{ pkgs ? import <nixpkgs> {} }: # see #install for instructions
pkgs.snack-lib.executable
  { src = ./src; # Where you source code is located
    main = "Main"; # The name of your main module

    # You Haskell dependencies
    dependencies =
      [
        "heterocephalus"
        "servant"
        "servant-server"
        "warp"
        "unliftio"
        "uuid"
      ];

    # GHC options
    ghc-options = [ "-Wall" ];

    # Extra directories to add to your build, by module
    extra-directories = modName:
      if modName == "Main" then
      [ ./pages ]
      else [];
  }

You can then build with:

$ snack build

or run with:

$ snack run
> ...

or start an interactive session:

$ snack ghci
> ...

Currently snack only supports building executables. See the test suite for examples.

Install

The easiest way to install it is to add it to your nix shell:

{ pkgs ? import <nixpkgs> {} }:
let
  snack = (pkgs.callPackage path/to/snack {}).snack-exe;
in pkgs.mkShell
  { name = "snack-shell";
    buildInputs = [ snack ];
  }