-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
83 lines (82 loc) · 2.98 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
description = "dekking";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-24.05";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
validity.url = "github:NorfairKing/validity";
validity.flake = false;
autodocodec.url = "github:NorfairKing/autodocodec";
autodocodec.flake = false;
safe-coloured-text.url = "github:NorfairKing/safe-coloured-text";
safe-coloured-text.flake = false;
fast-myers-diff.url = "github:NorfairKing/fast-myers-diff";
fast-myers-diff.flake = false;
sydtest.url = "github:NorfairKing/sydtest";
sydtest.flake = false;
opt-env-conf.url = "github:NorfairKing/opt-env-conf";
opt-env-conf.flake = false;
};
outputs =
{ self
, nixpkgs
, pre-commit-hooks
, validity
, safe-coloured-text
, fast-myers-diff
, sydtest
, opt-env-conf
, autodocodec
}:
let
system = "x86_64-linux";
nixpkgsFor = nixpkgs: import nixpkgs { inherit system; };
pkgs = nixpkgsFor nixpkgs;
allOverrides = pkgs.lib.composeManyExtensions [
(pkgs.callPackage (validity + "/nix/overrides.nix") { })
(pkgs.callPackage (autodocodec + "/nix/overrides.nix") { })
(pkgs.callPackage (safe-coloured-text + "/nix/overrides.nix") { })
(pkgs.callPackage (fast-myers-diff + "/nix/overrides.nix") { })
(pkgs.callPackage (sydtest + "/nix/overrides.nix") { })
(pkgs.callPackage (opt-env-conf + "/nix/overrides.nix") { })
self.overrides.${system}
];
haskellPackagesFor = nixpkgs: (nixpkgsFor nixpkgs).haskellPackages.extend allOverrides;
haskellPackages = haskellPackagesFor nixpkgs;
in
{
overrides.${system} = pkgs.callPackage ./nix/overrides.nix { };
overlays.${system} = import ./nix/overlay.nix;
packages.${system} = {
inherit (haskellPackages) dekking; default = haskellPackages.dekking;
} // haskellPackages.dekkingPackages;
checks.${system} = {
release = haskellPackages.dekkingRelease;
shell = self.devShells.${system}.default;
e2e-test = import ./e2e-test { inherit (pkgs) lib linkFarm; baseHaskellPackages = haskellPackages; };
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
hlint.enable = true;
hpack.enable = true;
ormolu.enable = true;
nixpkgs-fmt.enable = true;
nixpkgs-fmt.excludes = [ ".*/default.nix" ];
cabal2nix.enable = true;
tagref.enable = true;
};
};
};
devShells.${system}.default = haskellPackages.shellFor {
name = "dekking-shell";
packages = p: builtins.attrValues p.dekkingPackages;
withHoogle = true;
doBenchmark = true;
buildInputs = (with pkgs; [
cabal-install
niv
zlib
]) ++ self.checks.${system}.pre-commit.enabledPackages;
shellHook = self.checks.${system}.pre-commit.shellHook;
};
};
}