-
Notifications
You must be signed in to change notification settings - Fork 425
/
release.nix
55 lines (48 loc) · 1.46 KB
/
release.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
54
55
let
pkgsNix = import ./nix/pkgs.nix;
pkgsNative = pkgsNix.native;
pkgsx86_64-static = pkgsNix.x86_64-static;
pkgsAarch64-static = pkgsNix.aarch64-static;
hsApp = {
pkgs ? pkgsNative
, configureFlags ? []
}:
let
hNix = import ./default.nix { pkgs = pkgs; };
in
hNix // {
hadolint = hNix.hadolint // {
components = hNix.hadolint.components // {
exes = hNix.hadolint.components.exes // {
hadolint = hNix.hadolint.components.exes.hadolint // {
dontStrip = false;
dontPatchElf = false;
configureFlags = configureFlags;
};
};
};
};
};
staticFlags = {pkgs}: [
"--disable-executable-dynamic"
"--disable-shared"
"--disable-library-for-ghci"
"--ghc-option=-optl=-pthread"
"--ghc-option=-optl=-static"
"--ghc-option=-optl=-L${pkgs.gmp6.override { withStatic = true; }}/lib"
"--ghc-option=-optl=-L${pkgs.glibc.static}/lib"
];
appNative = hsApp {};
appx86_64-static = hsApp {
pkgs = pkgsx86_64-static;
configureFlags = staticFlags pkgsx86_64-static;
};
appAarch64-static = hsApp {
pkgs = pkgsAarch64-static;
configureFlags = staticFlags pkgsAarch64-static;
};
in {
native = appNative.hadolint.components.exes.hadolint;
linux-static = appx86_64-static.hadolint.components.exes.hadolint;
linux-arm-static = appAarch64-static.hadolint.components.exes.hadolint;
}