forked from ierton/vkhs
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdefault.nix
54 lines (46 loc) · 1.96 KB
/
default.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
41
42
43
44
45
46
47
48
49
50
51
52
53
{ nixpkgs ? import <nixpkgs> {},
ghc ? "ghc844",
force_build ? false }:
let
inherit (nixpkgs) pkgs;
vkhs = { mkDerivation, aeson, aeson-pretty, base, bytestring
, case-insensitive, clock, containers, data-default-class
, directory, filepath, http-client, http-client-tls, http-types
, mtl, network-uri, optparse-applicative, parsec, pipes, pipes-http
, pretty-show, regexpr, split, stdenv, taglib, tagsoup, text, time
, utf8-string, vector, cabal-install, zlib, haskdogs, hasktags, scientific
, hdevtools, lens, flippers
}:
mkDerivation {
pname = "VKHS";
version = "1.9.2";
src = ./.;
isLibrary = true;
isExecutable = true;
extraLibraries = [taglib zlib];
libraryHaskellDepends = [
aeson aeson-pretty base bytestring case-insensitive clock
containers data-default-class directory filepath http-client
http-client-tls http-types mtl network-uri optparse-applicative
parsec pipes pipes-http pretty-show split taglib tagsoup time
utf8-string vector cabal-install zlib scientific
hdevtools pkgs.python3 lens flippers
];
executableHaskellDepends = [ regexpr text haskdogs ];
executableToolDepends = [ haskdogs hasktags ];
doHaddock = false;
homepage = "http://github.com/grwlf/vkhs";
description = "Provides access to Vkontakte social network via public API";
license = stdenv.lib.licenses.bsd3;
shellHook=''
if test -f /etc/myprofile ; then
. /etc/myprofile
fi
export LIBRARY_PATH=${pkgs.zlib}/lib:${pkgs.taglib}/lib
build() {( cabal --ghc-options=-freverse-errors build "$@" ; )}
repl() {( cabal --ghc-options=-freverse-errors repl "$@" ; )}
'';
};
drv = p : pkgs.haskell.packages.${ghc}.callPackage p {};
in
if !force_build && pkgs.lib.inNixShell then (drv vkhs).env else (drv vkhs)