-
Notifications
You must be signed in to change notification settings - Fork 19
/
default.nix
53 lines (46 loc) · 1.21 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
53
# You can build this repository using Nix by running:
#
# $ nix-build
#
# You can also open up this repository inside of a Nix shell by running:
#
# $ nix-shell
#
# ... and then Nix will supply the correct Haskell development environment for
# you
{ compiler ? null
}:
let
config = { };
overlay = pkgsNew: pkgsOld: {
haskellPackages =
let
packageSet =
if compiler == null
then pkgsOld.haskellPackages
else pkgsOld.haskell.packages.${compiler};
in packageSet.override (old: {
overrides =
let
fromCabal2nix = self: super: {
nix-diff =
# see a note in flake.nix
pkgsNew.haskell.lib.dontCheck
(self.callCabal2nix "nix-diff" ./. { });
};
fromDirectory = pkgsNew.haskell.lib.packagesFromDirectory {
directory = ./nix;
};
default = old.overrides or (_: _: {});
in
pkgsNew.lib.fold pkgsNew.lib.composeExtensions default [
fromCabal2nix
fromDirectory
];
});
};
pkgs =
import <nixpkgs> { inherit config; overlays = [ overlay ]; };
in
{ nix-diff = pkgs.haskellPackages.nix-diff;
}