mirror of
https://github.com/nmattia/snack.git
synced 2024-11-28 12:27:41 +03:00
Nix-based incremental build tool for Haskell projects
bin | ||
nix | ||
script | ||
snack-lib | ||
tests | ||
.gitignore | ||
.travis.yml | ||
default.nix | ||
README.md | ||
shell.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 ];
}