forked from Gabriella439/nix-diff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (43 loc) · 1.35 KB
/
flake.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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, utils, ... }:
let
config = { };
overlay = pkgsNew: pkgsOld: {
nix-diff =
pkgsNew.haskell.lib.justStaticExecutables
pkgsNew.haskellPackages.nix-diff;
haskellPackages = pkgsOld.haskellPackages.override (old: {
overrides = self: super: {
nix-diff =
# There are quick check and golden tests.
# Quick check tests require random source to work.
# Golden tests require write access to the /nix/var
# and read access to the test data into /nix/store
# So we can't run these tests in build time
pkgsNew.haskell.lib.dontCheck
(self.callCabal2nix "nix-diff" ./. { });
};
});
};
in
{
overlays.default = overlay;
} //
(utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit config system; overlays = [ overlay ]; };
in
{
packages.default = pkgs.haskellPackages.nix-diff;
apps.default = {
type = "app";
program = "${pkgs.nix-diff}/bin/nix-diff";
};
devShells.default = pkgs.haskellPackages.nix-diff.env;
}
));
}