This repository has been archived by the owner on Feb 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
48 lines (48 loc) · 1.44 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
let
fix = f: let x = f x; in x;
in
{ sources ? fix (
self:
(import ./nix/sources.nix) // (if static then { nixpkgs = self.nixpkgs-haskell-static; } else {})
)
, compiler ? "ghc865"
, static ? false
}:
let
overlay = self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
"${compiler}" = super.haskell.packages.${compiler}.override {
overrides = hself: hsuper: {
log-parser = import sources.log-parser {
inherit sources compiler;
};
};
};
};
};
};
pkgs = (
import sources.nixpkgs {
overlays = [
overlay
];
}
).${if static then "pkgsMusl" else "pkgs"};
ngx-top = pkgs.haskell.packages.${compiler}.callPackage ./ngx-top.nix {};
in
pkgs.haskell.lib.overrideCabal ngx-top (
drv:
if static then {
configureFlags = drv.configureFlags or [] ++ [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.ncurses.override { enableStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib"
];
enableSharedExecutables = false;
enableSharedLibraries = false;
}
else {}
)