-
Notifications
You must be signed in to change notification settings - Fork 5
/
shell.nix
40 lines (40 loc) · 1.33 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs ? import <nixpkgs> {} }:
let
pkg = (import ./default.nix {}).env;
in
pkgs.lib.overrideDerivation pkg (drv: {
shellHook = ''
export AF_PRINT_ERRORS=1
export PATH=$PATH:${pkgs.haskellPackages.doctest}/bin
export PATH=$PATH:${pkgs.haskellPackages.cabal-install}/bin
function ghcid () {
${pkgs.haskellPackages.ghcid.bin}/bin/ghcid -c 'cabal v1-repl lib:arrayfire'
};
function test-runner () {
${pkgs.silver-searcher}/bin/ag -l | \
${pkgs.entr}/bin/entr sh -c \
'cabal v1-configure --enable-tests && \
cabal v1-build test && dist/build/test/test'
}
function doctest-runner () {
${pkgs.silver-searcher}/bin/ag -l | \
${pkgs.entr}/bin/entr sh -c \
'cabal v1-configure --enable-tests && \
cabal v1-build doctests && dist/build/doctests/doctests src/ArrayFire/Algorithm.hs'
}
function exe () {
cabal run main
}
function repl () {
cabal v1-repl lib:arrayfire
}
function docs () {
cabal haddock
open ./dist-newstyle/*/*/*/*/doc/html/arrayfire/index.html
}
function upload-docs () {
cabal haddock --haddock-for-hackage
cabal upload -d dist-newstyle/arrayfire-*.*.*.*-docs.tar.gz --publish
}
'';
})