-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathflake.nix
80 lines (71 loc) · 2.25 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
hl = pkgs.haskell.lib;
in
{
packages = {
inherit (pkgs.haskellPackages) keter;
default = pkgs.haskellPackages.keter;
};
checks = {
inherit (pkgs.haskellPackages) keter;
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
cabal-fmt.enable = true;
deadnix.enable = true;
hlint.enable = true;
markdownlint.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
stylish-haskell.enable = true;
};
};
integratedTests = pkgs.callPackage ./vm.nix { inherit self; };
};
devShells.default = pkgs.haskellPackages.shellFor {
packages =
let devPkgs = [ ];
in p: [ (hl.addBuildDepends p.keter devPkgs) ];
buildInputs = with pkgs.haskellPackages; [
cabal-fmt
cabal-install
hlint
];
inherit (self.checks.${system}.pre-commit-check) shellHook;
};
}) // {
overlays.default = _: prev: {
haskell = prev.haskell // {
# override for all compilers
packageOverrides = prev.lib.composeExtensions prev.haskell.packageOverrides (_: hprev: {
tar = hprev.tar_0_6_3_0;
keter =
let
haskellSourceFilter = prev.lib.sourceFilesBySuffices ./. [
".cabal"
".hs"
".c"
"LICENSE"
];
in
hprev.callCabal2nix "keter" haskellSourceFilter { };
});
};
};
};
}