-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
default.nix
42 lines (34 loc) · 1.23 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
{ nixpkgs ? import <nixpkgs> { crossSystem = { config = "x86_64-unknown-linux-musl"; }; }, compiler ? "ghc841" }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, scotty, stdenv }:
mkDerivation {
pname = "blank-me-up";
version = "0.1.0.0";
src = pkgs.lib.sourceByRegex ./. [
".*\.cabal$"
"^Setup.hs$"
"^Main.hs$"
];
isLibrary = false;
isExecutable = true;
enableSharedExecutables = false;
enableSharedLibraries = false;
executableHaskellDepends = [ base scotty ];
license = stdenv.lib.licenses.bsd3;
configureFlags = [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.libiconv.override { enableStatic = true; }}/lib"
];
};
normalHaskellPackages = pkgs.haskell.packages.${compiler};
haskellPackages = with pkgs.haskell.lib; normalHaskellPackages.override {
overrides = self: super: {
aeson = dontHaddock (dontCheck (super.aeson));
};
};
drv = haskellPackages.callPackage f {};
in
if pkgs.lib.inNixShell then drv.env else drv