1
1
mirror of https://github.com/nmattia/snack.git synced 2024-09-21 00:29:37 +03:00
Nix-based incremental build tool for Haskell projects
Go to file
2018-06-16 13:35:39 +02:00
bin Add TH support in GHCi 2018-06-02 00:31:23 +02:00
nix snack-lib: rename folder to match the nix name 2018-06-08 13:44:49 +01:00
script Add support for libraries 2018-06-15 22:21:23 +02:00
snack-lib Remove some occurrences of baseByModuleName 2018-06-16 13:35:39 +02:00
tests Add support for libraries 2018-06-15 22:21:23 +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 ];
  }