Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
102 lines (85 loc) · 2.69 KB
/
Copy pathflake.nix
File metadata and controls
102 lines (85 loc) · 2.69 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
botocore = {
# Lock botocore until we fix https://github.com/issue/888
url = "github:boto/botocore/f14ab129706a99198d42eed78d75350ea61c48e9";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, botocore }:
flake-utils.lib.eachDefaultSystem (system:
let
pre-commit = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
cabal-fmt.enable = true;
nixpkgs-fmt.enable = true;
ormolu.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
prettier = {
enable = true;
files = "\\.json$";
};
};
};
pkgs = import nixpkgs {
inherit system;
config.allowBroken = true;
};
# The ghc compiler version patch level will be the latest that is available in nixpkgs.
ghc96 = pkgs.haskell.packages."ghc96";
ghc98 = pkgs.haskell.packages."ghc98";
ghc910 = pkgs.haskell.packages."ghc910";
ghc912 = pkgs.haskell.packages."ghc912";
ghc914 = pkgs.haskell.packages."ghc914";
# The default ghc to use when entering `nix develop`.
ghcDefault = ghc914;
renameVersion = version: "ghc" + (pkgs.lib.replaceStrings [ "." ] [ "" ] version);
mkDevShell = hsPkgs: pkgs.mkShell {
name = "amazonka-${renameVersion hsPkgs.ghc.version}";
buildInputs = [
# Haskell Toolchain
hsPkgs.ghc
pkgs.cabal-install
# Package Dependencies
pkgs.gmp
pkgs.ncurses
pkgs.pkg-config
pkgs.zlib
# Development Tools
pkgs.haskellPackages.cabal-fmt
pkgs.haskell-language-server
pkgs.hlint
pkgs.nixpkgs-fmt
pkgs.ormolu
# Releases
pkgs.gh
pkgs.parallel
];
shellHook = pre-commit.shellHook + ''
export BOTOCORE=${botocore.outPath}
echo "botocore: $BOTOCORE"
'';
};
in
{
checks = {
inherit pre-commit;
};
devShells = {
ghc96 = mkDevShell ghc96;
ghc98 = mkDevShell ghc98;
ghc910 = mkDevShell ghc910;
ghc912 = mkDevShell ghc912;
ghc914 = mkDevShell ghc914;
default = mkDevShell ghcDefault;
};
});
}