-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
33 lines (33 loc) · 1.03 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
{ compiler ? "ghc96", enableProfiling ? false, haskell, haskellPackages
, nix-gitignore, removeReferencesTo, symlinkJoin, makeWrapper }:
let
src =
nix-gitignore.gitignoreSource [ "default.nix" "flake.nix" "shell.nix" ] ./.;
haskellPackages = haskell.packages.${compiler}.override {
overrides = self: super: {
# haskeline =
# haskell.lib.dontCheck (super.haskeline);
ap-normalize = haskell.lib.dontCheck (super.ap-normalize);
};
};
pkg = (haskellPackages.callCabal2nix "specstrom" "${src}" { });
specstrom = (if enableProfiling then
haskell.lib.enableExecutableProfiling pkg
else
haskell.lib.justStaticExecutables pkg);
specstrom-wrapped = symlinkJoin {
name = "specstrom";
paths = [ specstrom ];
buildInputs = [ makeWrapper ];
postBuild = ''
mkdir -p $out/share
cp -r ${./ulib} $out/share/ulib
wrapProgram $out/bin/specstrom \
--add-flags "-I$out/share/ulib"
'';
};
in {
inherit haskellPackages;
package = pkg;
specstrom = specstrom-wrapped;
}