forked from spacchetti/spacchetti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
70 lines (62 loc) · 1.65 KB
/
shell.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
h = haskellPackages.override {
overrides = self: super: {
# libnix pinning
libnix = super.mkDerivation {
pname = "libnix";
version = "0.3.0";
src = fetchFromGitHub {
owner = "Profpatsch";
repo = "libnix-haskell";
rev = "b891f4f425da5fa3e7e06bce98c56cf6cb6c876c";
sha256 = "00wbz83mlgqq5ml7ysdw6wfr74grpac7sj3v9cylvhy2blx922yp";
};
license = lib.licenses.gpl3;
buildDepends = with self; [ protolude aeson errors tasty-hunit ];
doCheck = false;
};
};
};
hDeps = with h; [
libnix
dhall
aeson-pretty
either
async-pool
insert-ordered-containers
retry
];
overrideAttrs = attrs: f: attrs // f attrs;
smallShellArgs = {
buildInputs = [
dhall
dhall-json
perl
jq
psc-package
];
};
fullShellArgs = overrideAttrs smallShellArgs (old: {
buildInputs = old.buildInputs ++ hDeps;
nativeBuildInputs = [
h.cabal-install
(h.hoogleLocal { packages = hDeps; })
(h.ghcWithPackages (lib.const hDeps))
nix-prefetch-scripts
];
# for ghc
# we copy a lot of stuff of the haskellPackages env builder,
# because it is unfortunately not very composable.
LANG = "en_US.UTF-8";
inherit (h.libnix.env) shellHook;
} // (if glibcLocales != null
# TODO: remove once https://github.com/dhall-lang/dhall-haskell/issues/504 is fixed
then { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
else {})
);
in
mkShell (fullShellArgs // {
passthru.small = mkShell smallShellArgs;
})