-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
52 lines (45 loc) · 1.53 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
# CAUTION! a spelling mistake in arg string is ignored silently.
#
# To use ghc-8.10.7
# nix-shell --argstr compiler "ghc8107"
{
nixpkgs ?
import (builtins.fetchTarball
https://github.com/NixOS/nixpkgs/archive/refs/tags/22.05.tar.gz)
{}
, compiler ? "ghc922"
}:
let
utils =
let src = fetchGit {
url = "git@github.com:composewell/composewell-haskell.git";
ref = "master";
}; in (import "${src}/utils.nix") { inherit nixpkgs; };
haskellPackages =
let src = fetchGit {
url = "git@github.com:composewell/composewell-haskell.git";
ref = "master";
}; in (import "${src}/haskellPackages.nix")
{ inherit nixpkgs;
inherit compiler; };
mkHaskellPackages = inShell:
haskellPackages.override (old: {
overrides =
nixpkgs.lib.composeExtensions
(old.overrides or (_: _: {}))
(with nixpkgs.haskell.lib; self: super: {
bench-report =
utils.local super "bench-report" ./. "" inShell;
bench-show = super.callHackageDirect {
pkg = "bench-show";
ver = "0.3.2";
sha256 =
"16b8vyzdp9b5bh34kqmbfwjsyv8wgnxxwl8kjcpgxjsh52xzyaa0";
} { };
});
});
shellDrv = mkHaskellPackages true;
shell = utils.mkShell shellDrv (p: [p.bench-report]) true;
in if nixpkgs.lib.inNixShell
then shell
else (mkHaskellPackages false).bench-report