-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
29 lines (27 loc) · 1.11 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
{ nixpkgs ? import <nixpkgs> {}
, pkgs ? nixpkgs.pkgs, haskell ? pkgs.haskell
, compiler ? "ghc802"
, ghcOrig ? pkgs.haskell.packages."${compiler}"
, localYT ? false
}:
let
overcabal = pkgs.haskell.lib.overrideCabal;
hubsrc = repo: rev: sha256: pkgs.fetchgit { url = "https://github.com/" + repo; rev = rev; sha256 = sha256; };
overc = old: args: overcabal old (oldAttrs: (oldAttrs // args));
overhub = old: repo: rev: sha256: args: overc old ({ src = hubsrc repo rev sha256; } // args);
overhage = old: version: sha256: args: overc old ({ version = version; sha256 = sha256; } // args);
ghc = ghcOrig.override (oldArgs: {
overrides = with haskell.lib; new: old:
let parent = (oldArgs.overrides or (_: _: {})) new old;
in with new; parent // {
unicode-show = dontCheck old.unicode-show;
};
});
###
nakeDrv = ghc.callPackage (import ./.) {};
drv = (haskell.lib.addBuildTools nakeDrv
[ pkgs.cabal-install
pkgs.stack
ghc.intero
]);
in if pkgs.lib.inNixShell then drv.env else drv